[Pkg-rust-maintainers] Bug#979002: rust-libm: autopkgtest failure on i386: 1.10009765625 is not equal to 2.0

plugwash plugwash-urgent at p10link.net
Sat Jan 2 04:39:30 GMT 2021


tags 979002 +patch
thanks

I just whipped up a patch which made cargo test pass on debian i386, 
it's not particularly pretty though.

floor, ceil, round, roundf and rem_pio2f (but not floorf or ceilf) use 
an add/sub trick to round stuff to the nearest integer. Unfortunately 
while this trick works on architectures that use modern FPUs it seems to 
break on x87. Presumably due to excess precision.


For floor and ceil I made the functions use alternative implementations 
based on the proposal at
https://github.com/rust-lang/libm/issues/219

For the other functions I added a conversion to/from bits, this seems to 
force rounding and make the tests pass, though I don't know for sure how 
robust that solution is. The finer points of rust floating point on x87 
do not seem to be documented anywhere.

Finally I loosened the test slightly for j1f

I've pushed my changes at https://github.com/plugwash/libm 
<https://github.com/plugwash/libm> and also posted about them upstream
at https://github.com/rust-lang/libm/issues/243

I may or may not add these changes to the Debian package later.



More information about the Pkg-rust-maintainers mailing list