News for hackers. Stuff that matters.
Re:Comparing Floating-Point Numbers Is Tricky by jnordwick on Thursday March 30, 2017 @09:41PM (#14000598)
> so many languages will round to the nearest integer if the float is within a certain margin

What language does this? It is more likely that it is printing out a truncated form but the number still contains that small difference, such as it will print "1.1" even though 1.1 isn't exactly representable in binary. This comes from the often used Grisu set of algorithms for printing which (in Grisu3) prints the smallest string that can represent the floating point bit pattern.

Re:Comparing Floating-Point Numbers Is Tricky by luhn on Thursday March 30, 2017 @11:06PM (#14000905)
That behavior was what I was referring to. I only have limited understanding on the topic; it seems my explanation was not quite right. Thanks for correcting me.