[OT] Sharp Regrets: Top 10 Worst C# Features

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 20 09:22:20 PDT 2015


On Thursday, 20 August 2015 at 14:52:53 UTC, renoX wrote:
> On Wednesday, 19 August 2015 at 14:01:34 UTC, Jonathan M Davis 
> wrote:
>> Yeah. I guess that the floating point stuff doesn't quite work 
>> that way thanks to NaN. *sigh* I hate floating point numbers. 
>> Sometimes, you have no choice other than using them, but man 
>> are they annoying.
>>
>> - Jonathan M Davis
>
> No IMHO, it's not really the fault of floating point numbers, 
> it's the languages fault: gloating point standard contain the 
> 'signaling NaN', if the languages used it by default then the 
> silent NaN many issues would never happen..
>
> Silent NaN are an optimisation which is quite useful in some 
> case but unfortunately the use of silent NaN by default in many 
> languages makes it a premature optimisation pushed by the 
> language designers over the poor unsuspecting programmers :-(

I really don't mind NaN. It really doesn't cause problems 
normally. The problem with floating point values is floating 
point values themselves. They're so painfully inexact. Even 
without NaN, you can't use == with them and expect it to work. 
Compared to that, how NaN is dealt with is a total non-issue. 
Floating points themselves just plain suck. They're sometimes 
necessary, but they suck.

- Jonathan M Davis


More information about the Digitalmars-d mailing list