Extend the small inverse pow5 offset table#237
Extend the small inverse pow5 offset table#237keith-packard wants to merge 1 commit intoulfjack:masterfrom
Conversation
12a63e0 to
e20b956
Compare
The maximum value for the invPow5 function is 342, which means the offset table needs 342 * 2 = 684 bits or > 21 32-bit values. Add the missing values by computing them based off the full table values. Signed-off-by: Keith Packard <keithp@keithp.com>
e20b956 to
78e3e5b
Compare
|
It would be good to add tests for this case; are there numbers that don't work correctly due to the missing entries? |
|
There are cases which access beyond the bounds of the array; that's what I discovered when I enabled array bounds checking and ran my test suite. I'm not sure I can easily re-create that situation though, it's been a long time. |
|
Ok, got it. The asserts are correctly failing the tests, and - for parsing - we need to support at least up to 324 (is the 342 a typo?). I filed #255 for this. Note that the table is generated from Java code. I'll update the generator and then update the file. |
Awesome. Thanks for digging into this; I'll update my C library with the new values. |
|
and, of course, if you ever decide to generate tables and code for 80- bit (intel/m68k) and 128-bit (ieee binary 128) forms, that'd be super exciting. I still have janky code for those two types and just haven't found the time to figure out how to fix that. |
The maximum value for the invPow5 function is 342, which means the offset table needs 342 * 2 = 684 bits or > 21 32-bit values. Add the missing values by computing them based off the full table values.