Re:9999999999999999.0 – 9999999999999998.0
by analog31 on Saturday January 05, 2019 @10:35PM
(#18836402)
I majored in math and physics. In math, our version of the course was called "numerical analysis," and we covered those things. In physics, the behavior of floating point math was covered in one of our lab courses.
I don't know what's taught to CS majors, and as others have pointed out, programmers don't necessarily study CS.
I believe the issue is just that the pitfalls of floating point are not apparent without a certain level of math education.
But there may be one more pitfall, which is that those of us using FP regularly, also happen to be "scientific" or "exploratory" programmers who haven't learned a lot of formal software engineering discipline (including me). So we understand the math but might be more prone to making mistakes with it.
I do kind of like the idea of flagging any number that is potentially exposed to a FP issue. We all make mistakes. Displaying all floats in exponential notation by default would be a good enough warning to the wary. We only display them as decimals for readability.
I don't know what's taught to CS majors, and as others have pointed out, programmers don't necessarily study CS.
I believe the issue is just that the pitfalls of floating point are not apparent without a certain level of math education.
But there may be one more pitfall, which is that those of us using FP regularly, also happen to be "scientific" or "exploratory" programmers who haven't learned a lot of formal software engineering discipline (including me). So we understand the math but might be more prone to making mistakes with it.
I do kind of like the idea of flagging any number that is potentially exposed to a FP issue. We all make mistakes. Displaying all floats in exponential notation by default would be a good enough warning to the wary. We only display them as decimals for readability.