1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-28 10:57:26 +03:00

More floating point conversion test cases.

FossilOrigin-Name: 44a736a700ab12b398873400dc06cd334817842b4fa08bf8070a9ad6dbff0b51
This commit is contained in:
drh
2026-03-01 23:23:52 +00:00
parent 7e4e866baf
commit ffaf9110f6
3 changed files with 51 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
C New\sfloating-point\stest\scase.
D 2026-03-01T23:01:17.452
C More\sfloating\spoint\sconversion\stest\scases.
D 2026-03-01T23:23:52.724
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -1132,7 +1132,7 @@ F test/fork-test.c 9ac2e6423a1d38df3d6be0e8ac15608b545de21e2b19d9d876254c5931b63
F test/format4.test eeae341953db8b6bda7f549044797c3278a6cc345d11ada81471671b654f8ef4
F test/fp-speed-1.c b37de94eba034e1703668816225f54510ec60fb0685406608cc707afe6b8234d
F test/fpconv1.test 63f352682fa65601a326563ad633086df6ab194e6ed5e7366786f38a525a7fd7
F test/fptest01.sql 73caa1c71ff0d74d5e76d9ad98d9c4a26f3d928f3cd7f737196cf209dffe7cae
F test/fptest01.sql 210562ad8d5a7895f26273dd3be56561a41bcb51d78a28a337af0f1ceaa3bb8d
F test/fts-9fd058691.test 78b887e30ae6816df0e1fed6259de4b5a64ad33c
F test/fts3.test 672a040ea57036fb4b6fdc09027c18d7d24ab654
F test/fts3_common.tcl dffad248f9ce090800e272017d2898005c28ee6314fc1dd5550643a02666907a
@@ -2197,8 +2197,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
P abecc8e388e294311aa0b572e0a984b8ddad2afbf829c1246e1682fa549c8fac
R 3a662ca0649735fc41e920572fb64776
P f353399932e9797198e635405a594c2987850070e3f9aee87a05c5a65d4c1e00
R 6cbc7c2f243f2aec8662e3be08e46909
U drh
Z 42f0fd55beedce180599a4c54b875ae0
Z bb1e7d38e72f541a9df8b1768869daa5
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
f353399932e9797198e635405a594c2987850070e3f9aee87a05c5a65d4c1e00
44a736a700ab12b398873400dc06cd334817842b4fa08bf8070a9ad6dbff0b51

View File

@@ -25,9 +25,52 @@ WITH
i1(i) AS (VALUES(0) UNION ALL SELECT i+1 FROM i1 WHERE i<15),
i2(j) AS (VALUES(0) UNION ALL SELECT j+1 FROM i2 WHERE j<0x7fe),
i3(k) AS (VALUES(0x0000000000000000),
(0x000fffffffffff00),
(0x000ffffffffffff0),
(0x0008080808080800)),
fpint(n) AS (SELECT (j<<52)+i+k FROM i2, i1, i3),
fp(n,r) AS (SELECT n, ieee754_from_int(n) FROM fpint)
SELECT n, r FROM fp WHERE r<>(0.0 + (r||''));
.check ''
# Another batch of 106,444 edge cases: All postiive floating point
# values that have only a single bit set in the mantissa part of the
# number.
#
.testcase 110
WITH
i1(i) AS (VALUES(0) UNION ALL SELECT i+1 FROM i1 WHERE i<51),
i2(j) AS (VALUES(0) UNION ALL SELECT j+1 FROM i2 WHERE j<0x7fe),
fpint(n) AS (SELECT (j<<52)+(1<<i) FROM i2, i1),
fp(n,r) AS (SELECT n, ieee754_from_int(n) FROM fpint)
SELECT n, r FROM fp WHERE r<>(0.0 + (r||''));
.check ''
# Verify that text -> binary64 conversions agree with system strtod().
# for 98,256 different edge-cases.
#
.testcase 200
.mode list
WITH
i1(i) AS (VALUES(0) UNION ALL SELECT i+1 FROM i1 WHERE i<15),
i2(j) AS (VALUES(0) UNION ALL SELECT j+1 FROM i2 WHERE j<0x7fe),
i3(k) AS (VALUES(0x0000000000000000),
(0x000ffffffffffff0),
(0x0008080808080800)),
fpint(n) AS (SELECT (j<<52)+i+k FROM i2, i1, i3),
fp(r) AS (SELECT ieee754_from_int(n) FROM fpint)
SELECT r FROM fp WHERE r<>strtod(r||'');
.check ''
# Another batch of 106,444 edge cases: All postiive floating point
# values that have only a single bit set in the mantissa part of the
# number.
#
.testcase 210
WITH
i1(i) AS (VALUES(0) UNION ALL SELECT i+1 FROM i1 WHERE i<51),
i2(j) AS (VALUES(0) UNION ALL SELECT j+1 FROM i2 WHERE j<0x7fe),
fpint(n) AS (SELECT (j<<52)+(1<<i) FROM i2, i1),
fp(r) AS (SELECT ieee754_from_int(n) FROM fpint)
SELECT r FROM fp WHERE r<>strtod(r||'');
.check ''