4 ms·
Are the two really equally precise though? There are many languages in which the `+` operator can be applied to types that are not integers.
by Crespyl 9y ago
Are the two really equally precise though?
There are many languages in which the `+` operator can be applied to types that are not integers.
- wellpast 9y agoIt depends on what you're trying to express to the computer. Are you trying to say plus two integers -- if you are trying to say something specific about the types -- then you have to say types to be precise. But if all you're doing is saying I want "add" to have the same semantics as "+", regardless of types, then you are perfectly precise and you are done. This is a toy example, obviously, but this line of reasoning extends to real-world examples.