Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix coercion of floats to integer for %d printf specifier
Fixes JuliaLang#37507. The issue here was the calling of `trunc` instead of `round` when coercing `AbstractFloat` arguments to `Integer`. Note this throws a scary warning and has undefined behavior in C, but it looks like legacy Printf code supported this, so we can try to do the right thing here. Previously, Printf called the grisu equivalent of `Ryu.writefixed(x, precision=0)` for float arguments, but as far as I can tell, calling `round(x)` should accomplish the same thing.
- Loading branch information