once again I am glad I am not a Python programmer.
What is this: "math.isclose()"???
In computing floating point numbers cannot be compared for equality. It is obvious why.
So "math.isclose()" is for people who cannot use "<" or ">" operators?
Golly. Do any programmers need it explained to them why floating point numbers are not precise and equality does not apply?
Decimal types are an abomination. The Fraction type blows my mind. Why? It is the sort of nonsense C++ programmers loved to do in the twentieth century, and we all (?) learnt from that and do not do such opaque things any more.
This is all very elementary mathematics, and a language is wasting its time making easy things easy. Programmers must learn the easy things
"math.isClose()" is making easy things easy. Not easier, a little bit harder, and it is hiding what is actually happening. Like the C++ nonsense I mentioned that did all that (and I was a sinner in those days)
"math.sin(..)" makes a hard thing easy, which is a good thing.
Do you see what I mean? math.colse()" increases the cognitive load for no benefit.
> Do you see what I mean? math.colse()" increases the cognitive load for no benefit.
That seems to me to be a matter of perspective. It doesn't increase cognitive load for me (appropriate name, meaning is clear, checking the implementation, that's how I would've done it anyway, etc.) so I guess opinions differ.
from your earlier comment:
> Golly. Do any programmers need it explained to them why floating point numbers are not precise and equality does not apply?
I think the answer is _yes_. Actually, all programmers need that explained to them. Especially python programmers, as python is used by a lot of beginning programmers. So I don't see the problem here.
What is this: "math.isclose()"???
In computing floating point numbers cannot be compared for equality. It is obvious why.
So "math.isclose()" is for people who cannot use "<" or ">" operators?
Golly. Do any programmers need it explained to them why floating point numbers are not precise and equality does not apply?
Decimal types are an abomination. The Fraction type blows my mind. Why? It is the sort of nonsense C++ programmers loved to do in the twentieth century, and we all (?) learnt from that and do not do such opaque things any more.
This is all very elementary mathematics, and a language is wasting its time making easy things easy. Programmers must learn the easy things