SQLite Forum

Decimal128
Login
Actually, on checking, I also modified func.c to use extended precision for the intermediate in the sum.  When I compile with GCC (MinGW) with the extended precision turned off, I get the same result as MSVC.

```
SQLite version 3.33.0 2020-06-22 16:13:37
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> pragma compile_options;
┌────────────────────────────────┐
│        compile_options         │
├────────────────────────────────┤
│ ALLOW_COVERING_INDEX_SCAN      │
│ ALLOW_URI_AUTHORITY            │
│ COMPILER=gcc-9.1.0             │
│ DEFAULT_CACHE_SIZE=-1048576    │
│ DEFAULT_FOREIGN_KEYS           │
│ DEFAULT_PAGE_SIZE=4096         │
│ DEFAULT_RECURSIVE_TRIGGERS     │
│ DEFAULT_WAL_AUTOCHECKPOINT=256 │
│ DEFAULT_WAL_SYNCHRONOUS=1      │
│ DEFAULT_WORKER_THREADS=8       │
│ ENABLE_8_3_NAMES=1             │
│ ENABLE_API_ARMOR               │
│ ENABLE_BYTECODE_VTAB           │
│ ENABLE_COLUMN_METADATA         │
│ ENABLE_COLUMN_USED_MASK        │
│ ENABLE_COSTMULT                │
│ ENABLE_CURSOR_HINTS            │
│ ENABLE_DBSTAT_VTAB             │
│ ENABLE_FTS3                    │
│ ENABLE_FTS3_PARENTHESIS        │
│ ENABLE_FTS4                    │
│ ENABLE_FTS5                    │
│ ENABLE_JSON1                   │
│ ENABLE_LOAD_EXTENSION          │
│ ENABLE_LOCKING_STYLE=1         │
│ ENABLE_MEMORY_MANAGEMENT       │
│ ENABLE_PREUPDATE_HOOK          │
│ ENABLE_RBU                     │
│ ENABLE_RTREE                   │
│ ENABLE_SESSION                 │
│ ENABLE_SNAPSHOT                │
│ ENABLE_STAT4                   │
│ ENABLE_STMT_SCANSTATUS         │
│ ENABLE_UNKNOWN_SQL_FUNCTION    │
│ ENABLE_UPDATE_DELETE_LIMIT     │
│ EXPLAIN_ESTIMATED_ROWS         │
│ EXTRA_INIT=core_init           │
│ HAVE_ISNAN                     │
│ LIKE_DOESNT_MATCH_BLOBS        │
│ MAX_ATTACHED=15                │
│ MAX_WORKER_THREADS=16          │
│ SOUNDEX                        │
│ STAT4_SAMPLES=64               │
│ TEMP_STORE=1                   │
│ THREADSAFE=1                   │
│ USE_DATETIME_NEW               │
│ USE_PRECISE_TIME               │
│ USE_URI                        │
└────────────────────────────────┘
sqlite> select sum(999.95) from wholenumber where value between 1 and 1000000;
┌──────────────────┐
│   sum(999.95)    │
├──────────────────┤
│ 999950000.017565 │
└──────────────────┘
sqlite>
```