aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
Commit message (Collapse)AuthorAge
* Internal doc typo fixes reported in [forum:01d15f21b6|forum post 01d15f21b6].stephan2025-02-27
| | | FossilOrigin-Name: d6514c20ff583ccc4fb3a526fb8f86a563224f513ee10bb39a978046bd952726
* Convert some expensive NEVER() and ASSERT() macros into assert()s.drh2025-02-10
| | | FossilOrigin-Name: 4aad891802d9d87f1ff3cbbf4bc70fa242c6782088189a2bd5d6f8863f552d29
* Further improvements to the decimal-to-float conversion for values closedrh2024-12-09
| | | | | to LARGEST_UINT64. FossilOrigin-Name: 453c949914770e8f7b9b9dd882db492bf8756c212c816f87bb2e3ed98bcd64e3
* Yet another iteration of the solution to the floating-point conversiondrh2024-12-07
| | | | | | problem - this what avoids complaints about oversize double values from -fsanitize. FossilOrigin-Name: fc6904a508eb732b1cb5cc12321a0d637d97e1e066a022a2c93cb50595f3a86a
* A cleaner and more robust solution to the floating-point conversion problemdrh2024-12-07
| | | | | originally fixed by [81342fa6dd03fffb]. FossilOrigin-Name: 351de57f80b73045448c71d3402d877ff5d72418b1f5fc34c8147a04f7c5cb78
* Fix harmless compiler warning caused by the previous check-in.drh2024-12-07
| | | FossilOrigin-Name: 462700aeb7c183d739ead4d726ce5384b3297bcf7929abd010987fa3a5f64807
* On x64 hardware, round-trip uint64_t→double→uint64_t conversionsdrh2024-12-07
| | | | | | | | | | | fail for values greater than UINT64_MAX-2047. This caused the SQLite text-to-float converter routine to give incorrect results for values between '1.8446744073709550592eNNN' and '1.8446744073709551609eNNN' for any exponent NNN. This problem was introduced by check-in [761d8fd18b0ee868] and first appeared in version 3.47.0 and was reported by [forum:/forumpost/569a7209179a7f5e|forum post 569a7209179a7f5e]. Fixed by this check-in. FossilOrigin-Name: 81342fa6dd03fffbe7d4d699ff049dcef4d30344578bb6f91cb58a4e5a4f6036
* Move the #include of hwtime.h from the bottom of util.c to the top ofdrh2024-10-19
| | | | | | vdbe.c so that it will be available when needed, even for non-amalgamation builds. FossilOrigin-Name: 5f23036a87f443c82fa7fd48fdac16a31128bb9288b71f97228c29bcfeb632fb
* Remove all code that makes use of the C-language "long double" datatype.drh2024-10-01
| | | FossilOrigin-Name: f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e
* New #ifdefs to omit code that is unused when SQLITE_USE_LONG DOUBLE is defined.drh2024-10-01
| | | FossilOrigin-Name: 98066e2d226e7d2eceec1931a1432baea956f49bf3c708d8a6d511fa4e864ca3
* Add compile-time option -DSQLITE_USE_LONG_DOUBLE=0 to omit all attempts to usedrh2024-10-01
| | | | | | "long double". Or =1 to omit attempts to use the Dekker algorithms to achieve high-resolution floating point. FossilOrigin-Name: ca5964ef70efad3332e0bf9c158eb5fd5006d3022051d1ac506c097c427735a1
* Improved header comment on the sqlite3FpDecode() implementation.drh2024-06-10
| | | | | | For the fpdecode() SQL function (available in debug builds only) limit the value of the third parameter (mxRound) to be positive. FossilOrigin-Name: 56af06fa12104a1fe119d7087746011183af053834eac72d0fb69f60d98054c6
* Fix another problem from [c63e26e705f5e967] involving infinities and thedrh2024-03-19
| | | | | | Kahan-Babushka-Neumaier summation algorithm. Problem reported by [forum:/forumpost/23b8688ef4|forum post 23b8688ef4]. FossilOrigin-Name: 45d272ef38d5ee6189f81369aefb8e3ac35868a67687012d93c84f2bbc42520a
* Work around obscure floating point issue seen with older versions of MSVC.mistachkin2024-03-06
| | | FossilOrigin-Name: 42d39f9140cc315df04b048f3811311fa50b51e1831d6cdf982fbce029778e43
* Always convert 32-bit integer literals into EP_IntValue notation, even ifdrh2024-02-28
| | | | | they contain "_" separators. FossilOrigin-Name: 2dfc427f676255cbe189a26bfec2405d41d31ccc4512c55b31e6e633261d7a23
* Allow "_" characters to appear between any two digits in an integer, real or ↵dan2024-02-27
|\ | | | | | | | | hexadecimal SQL literal. FossilOrigin-Name: 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b
| * Add extra checks for the validity of a numeric literal to ↵dan2024-01-23
| | | | | | | | | | sqlite3DequoteNumber(). FossilOrigin-Name: d57407ef59baf699b72c8c4859abfaa7977dd41f6f16eb8fe1d53a68806eb966
| * Fix a problem in the previous commit with hex literals that start with "0X" ↵dan2024-01-22
| | | | | | | | | | instead of "0x". FossilOrigin-Name: c063c89b11487e6e712b97de604db316fa97bcf91ed810bb2dcbbcb54c68dbf4
| * Allow underscores to occur in hex literals.dan2024-01-22
| | | | | | FossilOrigin-Name: 81a56229460cc5b6acfd3c3729fcf89ea3cccb546ca2b4f4035b140c60911e18
| * Allow "_" characters to appear following any digit in an integer or real SQL ↵dan2024-01-20
| | | | | | | | | | literal. FossilOrigin-Name: 401650aaccbc99246bd4e1ff37a28b78f528178aee2f294d87b9f7fecd7432bb
* | Fix rounding in zero-precision %f and %g printf conversions.drh2024-02-17
|/ | | | | | [forum:/info/393708f4a8|Forum post 393708f4a8]. This bug was introduced by check-in [32befb224b254639] and first appeared in version 3.43.0. FossilOrigin-Name: 7fca1bc482fc2456d75392eb42f768fda72631c9070de46b8123b1126e78306f
* Update #ifdef checks in pager.c and util.c to account for [0462a2612d1fc1d0] ↵stephan2023-12-22
| | | | | to resolve the build problem reported in [forum:9819032aac|forum post 9819032aac]. FossilOrigin-Name: 0f22d809a1c6c80e381f6bcd931fe4ec36dca0e28d07ab4f4f7f83c813424f60
* Simplification to sqlite3GetVarint32() to avoid confusing gcov.drh2023-10-19
| | | FossilOrigin-Name: 89862c51ad9715bedf5b029db484602e740f0db7404970d482ce503c1b9a0ed2
* According to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], olderdrh2023-09-14
| | | | | | | | MSVC compilers are unable to convert a double directly into an unsigned long long int, but must first go through a signed long long int. Work around this by restricting the range of doubles that are converted into long long integers so that only the lower 63 bits are used. FossilOrigin-Name: 0ab05871ba36e2a0eddfbc700c1d39891c54c453727a4effcdac3327efec163b
* Resolve a condition which could cause an is-interrupted db to call its ↵stephan2023-08-28
| | | | | progress callback. FossilOrigin-Name: a0d0f1aafc6086726131dff5e6628f2771c20db3122a53bdbb82945ab5d326d1
* Rename the decimal_sci() function to decimal_exp().drh2023-08-18
| | | | | [forum:/forumpost/fa027bb0ab|Forum post fa027bb0ab]. FossilOrigin-Name: c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695
* Use a dodgy substitute if the INFINITY macro is not available. Seedrh2023-08-15
| | | | | [forum:/forumpost/8e66e19bb9|forumpost 8e66e19bb9]. FossilOrigin-Name: 4ae72c896761df5cd37c98ca3eeee7d4c6af3e4ccf74edd88ff902ef38f0765b
* Merge latest trunk changes into this branch.dan2023-08-10
|\ | | | | FossilOrigin-Name: 3ed89c344fcb3b7ee8b764d95144643e42e053e1116150d6eda8355fbd6669df
| * Remove an unreachable branch in the ascii-to-floating-point conversion thatdrh2023-08-02
| | | | | | | | | | was added by [e989a37ff9d5b52e]. FossilOrigin-Name: c4347e4400e96f932ac12f8f22484a2ebce2a578d1b2181977954c432f117bfd
| * Avoid ASAN warnings when converting over-sized long double values into double.drh2023-08-01
| | | | | | FossilOrigin-Name: e989a37ff9d5b52e0090d59be077ad2260c8df5d4c2c2d8088b1160de64dffd4
* | Update the latest trunk enhancements into the wal-shm-exceptions branch.drh2023-07-24
|\| | | | | FossilOrigin-Name: 3187ee3f69fc28a259ba0e951ac10a65c07ef2c3866acbefaf9544333a930cc6
| * Avoid a potentially large strlen() in sqlite3DecOrHexToI64().drh2023-07-21
| | | | | | FossilOrigin-Name: 5413b02bb629b9cbb76f7e688e94ebcf24276c01436d3feb73ff57c036e1d2aa
* | Merge the latest trunk enhancements into the wal-shm-exceptions branch.drh2023-07-10
|\| | | | | FossilOrigin-Name: f655d08d019bab0c578886e91ca24fd956d1b3dea9b9c9104812b3cf62e5e556
| * Always use the "LL" suffix on 64-bit integer literals.drh2023-07-08
| | | | | | FossilOrigin-Name: 07d95ed60f0a17ea13b4bc19c2ab2ec9052fedd27c9e1e57a1ec6e3a6470e5b7
| * Fix harmless scan-build warnings.drh2023-07-08
| | | | | | FossilOrigin-Name: beab3c98639be531744e60440223bb9ee76bc15234aff05e5efb273c8241dfd8
| * Omit the use of memmove() in sqlite3FpDecode() in an attempt to avoiddrh2023-07-07
| | | | | | | | | | | | spurious warnings from valgrind. Also makes the code slightly smaller and faster. FossilOrigin-Name: b409943af00e35ad05906d0a80ffa1225a66f3d807c131e00cfbf6671a03a981
* | Merge all recent trunk enhancements into the wal-shm-exceptions branch.drh2023-07-06
|\| | | | | FossilOrigin-Name: e59cea2d851be68559e7d01a01cb05684c44d151d022ea9790ce99671016ab00
| * This is alternative work-around for the x86 float-point problem that usesdrh2023-07-05
| | | | | | | | | | "volatile" rather than compile-specific #pragmas. FossilOrigin-Name: 1d972a690fdc70ab40862bd38427d68b48e8802ddf8e5c301f2d58ce2178b6ec
| * Improved comments on the work-around to the GCC x86 floating point wonkiness.drh2023-07-05
| | | | | | FossilOrigin-Name: 7b4c16731e7bf6f03f5adf4fcb2008c0b19be473fb1b90b405c217c08916586a
| * Work around for an apparent GCC bug. Seedrh2023-07-05
| | | | | | | | | | [forum:/info/ee7278611394034c|forum post ee7278611394034c] for details. FossilOrigin-Name: 5d9e9364808793d65925d4efbfde0f4246df258758f15e8ce1105070d1018fe6
| * Make the order of operations explicit for the error term of Dekkerdrh2023-07-05
| | | | | | | | | | double-precision multiply. FossilOrigin-Name: 28f57b34e6b11184a36e363a985e7531bddd7be48a5e039a670e5acf748eedda
| * Simplification of the dekkerMul2() subroutine.drh2023-07-05
| | | | | | FossilOrigin-Name: bfe6432a46fd41bfadf4516a73b4e2523d9b453c3e4486fe6df7e1d25275dfb3
| * Enhance sqlite3AtoF() so that it honors the USELONGDOUBLE test-control.drh2023-07-03
| | | | | | | | | | Enable the test/atof1.test module on non-intel platforms. FossilOrigin-Name: b7850fd480535980d66f107c2746e7f7fc0a5379ec8244d84f7785533c83f276
| * Whether or not to use the long-double floating point conversion techniquedrh2023-07-03
| | | | | | | | | | is now a test-control setting. FossilOrigin-Name: 02ae6caff1f7925c696ad263fe78b1036364d24b6373e1baec10d53aafb14a12
| * New test cases for floating-point conversions.drh2023-07-03
| | | | | | FossilOrigin-Name: 9435ed76cd9bb1be02768b3853a2323834f67bda75d3e3f76f6aa7bd0bade3d7
| * Final clean-up of the idea of using Dekker double-precision floatingdrh2023-07-03
| | | | | | | | | | computations to improve accuracy. FossilOrigin-Name: 40285d631072b79aba39cc20d4b217bdf0069f29ac9902cb97dec28d3e4cde11
| * Squeeze as many bits as we can out of normalization.drh2023-07-03
| | | | | | FossilOrigin-Name: 25d1ad6df1ed460c2cc9f32e8a5106e121ae502044f83abf431c1d5b3879eb56
| * Faster Dekker multiplication that removes the restriction on input magnitude.drh2023-07-03
| | | | | | FossilOrigin-Name: 2994caf5884be07c889519c78fbac4ddcf267fcfe6a3265ecb6390bcd574532e
| * Fix one constant in the normalization logic. Improved error outputdrh2023-07-03
| | | | | | | | | | from atof1.test. FossilOrigin-Name: d3c48807100a358a70fdd799c8935eba1b765ace2e1ddea4475fd673006cb6da
| * Replace the dodgy error estimating logic in the previous check-in withdrh2023-07-03
| | | | | | | | | | | | full-up Dekker double-double multiplication, and this idea works much better. There are still a few inaccuracies, but it is much closer. FossilOrigin-Name: 4fa6938dac2d3d813a37664053db31451a2a065f78dd212488f5f7f8d583ddc5