diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-22 23:08:19 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-22 23:08:43 +0100 |
| commit | 6db5cdadd09fad0c8373e32dcfc7ab5b8bcb74e6 (patch) | |
| tree | fc08c4605bd18805712496afd1a957e4fad4b88f /html/net.html | |
| parent | da014d23dad4bcff0215d9ba7758652c85c06a20 (diff) | |
| download | puzzles-6db5cdadd09fad0c8373e32dcfc7ab5b8bcb74e6.zip puzzles-6db5cdadd09fad0c8373e32dcfc7ab5b8bcb74e6.tar.gz puzzles-6db5cdadd09fad0c8373e32dcfc7ab5b8bcb74e6.tar.bz2 puzzles-6db5cdadd09fad0c8373e32dcfc7ab5b8bcb74e6.tar.xz | |
Blackbox: correct FROMDRAW() macro for C division semantics
Integer division in C rounds towards zero, so if you want it to
consistently round down you need to ensure that the arguments are
positive. FROMDRAW() didn't do that, so clicks off the top and left
corners of the grid got treated as being in the top row or left column
(row and column 0) rather than ignored.
This commit fixes the macro so that it offsets its argument upward
before the division and compensates afterwards.
Diffstat (limited to 'html/net.html')
0 files changed, 0 insertions, 0 deletions