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 » U++ Library support » U++ Core » FormatDouble and numbers under 1e-15
FormatDouble and numbers under 1e-15 [message #25603] Wed, 03 March 2010 10:33 Go to previous message
koldo is currently offline  koldo
Messages: 3361
Registered: August 2008
Senior Veteran
Hello all

There is a behavior I do not understand in function String FormatDouble(double d, int digits, int flags, int pad_exp) with numbers under 1e-15.

If you call FormatDouble(1e-16, 0) it returns "1e-16" instead of returning "0".

This is because of this line:
is_exp = ad && (ad <= 1e-15 || ad >= 1e15);


The question is, if I do not want decimals or a few of them, and number is very close to 0, the most intuitive output would be just 0, is not it ?


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: More Xmlize functions
Next Topic: Format(Time time, bool seconds) problem
Goto Forum:
  


Current Time: Thu May 16 22:45:50 CEST 2024

Total time taken to generate the page: 0.02174 seconds