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  |
 |
koldo
Messages: 3435 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
|
|
|
Goto Forum:
Current Time: Mon May 12 00:52:21 CEST 2025
Total time taken to generate the page: 0.02797 seconds
|