mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-17 15:36:43 +00:00
round_i32 added 0.5 in f32, which rounds up at the binade crossing: 0.49999997 (0.5 - 2^-25) + 0.5 becomes 1.0, so round_i32 gave 1 (and -1 for the negative) where f32::round gives 0. The sum is now taken in f64, where it is exact for every f32 the i32 cast does not saturate; still no roundf call. rounding_matches_the_standard_library now covers +-0.49999997, the ties and 8388607.5, and a new test compares every f32 bit pattern in [-4096, 4096] against f32::round (0.6 s). Both fail on the previous head. The code comment and docs/oil-paint-performance.md no longer claim the f32 sum is exact. Co-authored-by: ebosido444-ai <316167330+ebosido444-ai@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>