2 ms·
You can't accidentally mix floats and ints, it's a typed language.
by xfer 9y ago
You can't accidentally mix floats and ints, it's a typed language.
- wtetzner 9y agoIt's typed, but the types can be fully inferred. If you didn't specify the types of your function, it could end up being inferred as float -> float -> float instead of int -> int -> int. The different operators are a concise way to tell the type-checker that you're working with floats.
- xfer 9y agoNo it won't be inferred as float->float->float if there is an int literal or whatever base type you pass to the function. Check typeclasses for how this works.