Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 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
Previous Topic: U++ Allocator & Vulkan
Next Topic: The next step: 32bit wchar
Goto Forum:
  


Current Time: Thu Jul 25 14:29:57 CEST 2024

Total time taken to generate the page: 0.01985 seconds