Always false float comparisons

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Mon May 9 14:03:14 PDT 2016


On Monday, 9 May 2016 at 20:20:00 UTC, Walter Bright wrote:
> On 5/9/2016 12:39 PM, tsbockman wrote:
>> Educating programmers who've never studied how to write 
>> correct FP code is too
>> complex of a task to implement via compiler warnings. The 
>> warnings should be
>> limited to cases that are either obviously wrong, or where the 
>> warning is likely
>> to be a net positive even for FP experts.
>
> I've seen a lot of proposals which try to hide the reality of 
> how FP works. The cure is worse than the disease. The same goes 
> for hiding signed/unsigned, and the autodecode mistake of 
> pretending that code units aren't there.

I completely agree that complexity that cannot be properly hidden 
should not be hidden. The underlying mechanisms of floating point 
is complexity that we shouldn't paper over. However, the 
peculiarities of language conventions w.r.t. floating point 
expressions doesn't quite fit that category.


More information about the Digitalmars-d mailing list