Home » Developing U++ » U++ Developers corner » Refining IsNull(double)
Refining IsNull(double) [message #57472] |
Fri, 27 August 2021 09:12 |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
I am once again revisiting this issue. I decided that putting DOUBLE_NULL_LIM somewhere at 1e-307 is amateurish as we can simply define
constexpr double DOUBLE_NULL = -std::numeric_limits<double>::infinity();
Now another thing that was already changed in the past is that NANs are now considered Null.
However, there is one issue I am not 100% sure about: what about positive infinity? Should we consider it Null or not?
There two inf counter-examples: exp(10000) probably rather should not be Null. But 1/0.0 probably rather should.
Well, for now I am going with inf is Null (because it has simpler test, std::abs(x) < inf...), but I am open for counterarguments...
Mirek
|
|
|
Goto Forum:
Current Time: Mon Apr 28 16:48:10 CEST 2025
Total time taken to generate the page: 0.00815 seconds
|