diff options
| author | eunhhu <[email protected]> | 2026-10-19 01:53:40 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-19 01:53:40 +0100 |
| commit | defb2cf06a9b5db9429ca368d8c2af127a5c9c3d (patch) | |
| tree | b13c94eb334ce2a5055854791900f8702ba9fc3b /core/module.h | |
| parent | 809a83a5764ec0f0c84b96c43a20cfb906eee031 (diff) | |
| download | pure-defb2cf06a9b5db9429ca368d8c2af127a5c9c3d.tar.gz pure-defb2cf06a9b5db9429ca368d8c2af127a5c9c3d.zip | |
027's 5c: money as i64 minor units shown by .Nd: NUM_TEXT's decimal form takes digits (bits 20-24 as FIXED's), an integer's last N digits written after a point (1234 at two is 12.34, -5 -0.05, 0 0.00; width and zeros after the sign), verification allowing digits on FIXED and DECIMAL alone; unit test: ten rows of formats_and_held (-2^63 at two, 25 digits, a number's whole 1234, its 12.5 a limit); TPC-C's money i64 cents and its rates ten-thousandths (tables, messages, load, the transactions), SQLite's INTEGER columns and int64 bindings alike, the comparison now exact (no 1e-9 tolerance): after 20,000 transactions every row of every table the same (grouped SQLite too) and 3.3.2 holding on both; counts: b45 against b44 BFS without batches +0.09%, the rest within 0.001%; the bank's queries (s44 and s45 in turns, six each) in_credit -0.59%, per_branch -0.34%, ranks -0.20%, the rest within 0.01%, the seven answers the same bytes; 008 (NUM_TEXT's digits, a message row's i64 cells), 027 and 092
Diffstat (limited to 'core/module.h')
| -rw-r--r-- | core/module.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/module.h b/core/module.h index ce8cebf..75e27ba 100644 --- a/core/module.h +++ b/core/module.h @@ -101,8 +101,10 @@ typedef enum { PURE_BITS_AND, PURE_BITS_OR, PURE_BITS_XOR, PURE_BITS_LEFT, PURE_ * NUM_TEXT's argument: bits 0-1 the value's type (as CONST's), 8-15 a width * the text is padded to on the left, bit 16 padding with zeros after a sign * (else spaces), 17-19 the form (PureFormat), 20-24 one more than the digits - * after the point of FIXED. A form of an integer takes an i64 or a whole - * number (else LIMIT), in its base with a sign; FIXED takes a number. */ + * after the point of FIXED or of DECIMAL (there the integer in minor units: + * 1234 at two digits is 12.34, as money's cents). A form of an integer takes + * an i64 or a whole number (else LIMIT), in its base with a sign; FIXED + * takes a number. */ enum { PURE_MODULE_HELD = 32, PURE_HELD_TEXT = 16, PURE_HELD_APPEND = 1 << 8 }; /* 027's stage 2b: lists in records. A record field of type LIST holds a list * of the record its default names. In an event's list (and the lists in its |
