Skip to content

Commit b092a06

Browse files
committed
fbc headers: ./inc/fblimits.bi
- adjust constant value MIN_VALUE_DOUBLE and MAX_VALUE_DOUBLE - somewhere in the conversion from literal value in source to double floating point value in memory there is a slight difference between windows/linux and DOS ports where the DOS port was overflowing the precision. - the adjustment appears to be valid on windows/linux/dos and since the decimal floating point representation as a literal is an approximation the adjustment should be still be acceptable to initialize the internal max floating point values.
1 parent 682a2ea commit b092a06

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: inc/fblimits.bi

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ namespace FB
112112
MAX_VALUE_SINGLE = 3.402823466e+38
113113

114114
const as double _
115-
MIN_VALUE_DOUBLE = -1.7976931348623158E+308#, _
116-
MAX_VALUE_DOUBLE = 1.7976931348623158E+308#
115+
MIN_VALUE_DOUBLE = -1.7976931348623157E+308#, _
116+
MAX_VALUE_DOUBLE = 1.7976931348623157E+308#
117117

118118
#if __FB_LANG__ = "fb"
119119
end namespace

Diff for: tests/numbers/limits.bas

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define max_int(T) cast(T, iif(is_signed(T), max_signed(T), max_unsigned(T)))
1919
#define max_single(T) cast(T, iif(is_single(T), 3.402823466e+38, 0))
2020
#define min_single(T) cast(T, -max_single(T))
21-
#define max_double(T) cast(T, iif(is_double(T), 1.7976931348623158D+308#, 0#))
21+
#define max_double(T) cast(T, iif(is_double(T), 1.7976931348623157D+308#, 0#))
2222
#define min_double(T) cast(T, -max_double(T))
2323
#define max_float(T) cast(T, iif(is_single(T), max_single(T), max_double(T)))
2424
#define min_float(T) cast(T, iif(is_single(T), min_single(T), min_double(T)))

0 commit comments

Comments
 (0)