News for hackers. Stuff that matters.
Re:0.30000000000000004 by poizan42 on Friday November 13, 2015 @07:45AM (#10559507)
Just say (0.1+0.2)*10-3. That works everywhere no matter the amount of rounding.
Re:0.30000000000000004 by static_noise on Friday November 13, 2015 @08:49AM (#10559795)
You've just invented fixed point numbers.
Re:0.30000000000000004 by poizan42 on Friday November 13, 2015 @11:54AM (#10560816)
I'm not sure I follow? The point here was to show that a language can't represent the decimal fractions exactly.
Re:0.30000000000000004 by recursive on Friday November 13, 2015 @12:06PM (#10560893)
But they can. Many languages have decimal and rational types.