September 08, 2002 There is an error? | ||||
---|---|---|---|---|
| ||||
But the operator == if it must confront operating that it is a NAN, raises a invalid exception? In the D's notes of the web site, there is the table of the "Floating point comparison operators" where there is written that == does not raise the exception Thak you -- Luigi -- void f (OS x) {while (x.getbugs() > 0); destroy(earth);}; f (windows); // No problem! |
September 08, 2002 Re: There is an error? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luigi | You shouldn't use op== to compare to nans. Use the isnan property instead. Or use the isnan() function in math.d. Anyway you don't get an exception. You get a false return value: if one of the operands is nan, op== always returns false, regardless of the context. Walter didn't want it to be an exception to the rule because he wants the language to be IEEE compliant. > But the operator == if it must confront operating that it is a NAN, raises a > invalid exception? > > In the D's notes of the web site, there is the table of the "Floating point > comparison operators" where there is written that == does not raise the exception > > Thak you > > -- > Luigi > -- > void f (OS x) {while (x.getbugs() > 0); destroy(earth);}; > f (windows); // No problem! > > |
Copyright © 1999-2021 by the D Language Foundation