aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2024-03-06 20:24:02 +0000
committermistachkin <mistachkin@noemail.net>2024-03-06 20:24:02 +0000
commit1bd583e201fbc1f81fc5cf0ba938c048742215f7 (patch)
tree3b3eec72faf7e063e3e6c044669af7e5efaa1351 /src
parenta64342ee9cca331cddda4c2c241d593c7516c999 (diff)
downloadsqlite-1bd583e201fbc1f81fc5cf0ba938c048742215f7.tar.gz
sqlite-1bd583e201fbc1f81fc5cf0ba938c048742215f7.zip
Work around obscure floating point issue seen with older versions of MSVC.
FossilOrigin-Name: 42d39f9140cc315df04b048f3811311fa50b51e1831d6cdf982fbce029778e43
Diffstat (limited to 'src')
-rw-r--r--src/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 311b7385a..8c9e980cd 100644
--- a/src/util.c
+++ b/src/util.c
@@ -665,6 +665,9 @@ do_atof_calc:
u64 s2;
rr[0] = (double)s;
s2 = (u64)rr[0];
+#if defined(_MSC_VER) && _MSC_VER<1700
+ if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); }
+#endif
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
if( e>0 ){
while( e>=100 ){