U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » Refining IsNull(double)
Refining IsNull(double) [message #57472] Fri, 27 August 2021 09:12
mirek is currently offline  mirek
Messages: 14291
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
Previous Topic: U++ Allocator & Vulkan
Next Topic: The next step: 32bit wchar
Goto Forum:
  


Current Time: Thu May 07 03:58:14 GMT+2 2026

Total time taken to generate the page: 0.00485 seconds