Skip to content

Conversation

@keith-packard
Copy link

@keith-packard keith-packard commented Apr 12, 2025

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.

@keith-packard keith-packard force-pushed the extend-small-inv-table branch from 12a63e0 to e20b956 Compare April 12, 2025 22:37
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>
@ulfjack
Copy link
Owner

ulfjack commented Jan 16, 2026

It would be good to add tests for this case; are there numbers that don't work correctly due to the missing entries?

@keith-packard
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants