News for hackers. Stuff that matters.
Re:In Erlang/OTP 27, +0.0 will no longer be exactly equal to... by kragen on Thursday May 11, 2023 @01:44PM (#35905579)
yeah, i also wrote a cube root routine using newton's method yesterday and came to the conclusion that |x - x'| < threshold was a better approach in that case. maybe in every case, maybe not

i agree that prefix notation is not as bad for these as i had thought before looking

i think there are plausible cases where your float might be polymorphic with double, complex, a vector, a matrix, or an element of a galois field, but i think it would only be polymorphic with int in cases like stopping change propagation when an observable value gets recomputed to the same value from new inputs, and in those cases what you need is exact bitwise equality, not arithmetic equality

an awk-like thing might be better with fixed-point, like tex and metafont; you could call the data type 'btc` and represent it as a 64-bit integer that's multiplied by 10*-8 for output

There are no comments on this comment yet.