2 ms·
> I strongly feel they were poorly implemented. I'll agree with this. In the context of Python, the behavior is surprising. > but in Python it is implemented
by khedoros 10y ago
> I strongly feel they were poorly implemented.
I'll agree with this. In the context of Python, the behavior is surprising.
> but in Python it is implemented in a different way that is mathematically (but not pragmatically) incorrect.
I disagree with this statement, for pedantic reasons. I wouldn't expect someone to use "/" in the context of standard arithmetic to mean integer division without explicitly redefining it, but redefining it would certainly be "mathematically correct". Look at the notation for Galois fields. That redefines all of the standard operators to work within a field of limited elements, and I'd consider the use-case to be comparable.
- jhall1468 10y ago> Look at the notation for Galois fields. That redefines all of the standard operators to work within a field of limited elements, and I'd consider the use-case to be comparable. Finite fields define standard operators because using mathematical operations two sets of fields is ambiguous. So I don't consider that "redefining", in the sense that they are being used unexpectedly, I consider that just defining how to use them in this special use case. Whereas Python is defining / to do two operations: divide and truncate. I call that redefining because there's a certain expected outcome if you've had elementary math, and that's not what Python delivers.