Home » Developing U++ » U++ Developers corner » Refining IsNull(double)
Refining IsNull(double) [message #57472] |
Fri, 27 August 2021 09:12 |
![](https://www.ultimatepp.org/forums/images/custom_avatars/3.png) |
mirek
Messages: 14000 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: Sat Jul 27 03:24:17 CEST 2024
Total time taken to generate the page: 0.03739 seconds
|