BurntSushi / byteorder

Rust library for reading/writing numbers in big-endian and little-endian.
The Unlicense
981 stars 143 forks source link

Examples for read/write_f32_into use literals that are too large #123

Closed evertrol closed 5 years ago

evertrol commented 6 years ago

Running the examples for read_f32_into_unchecked and write_f32_into produce two

warning: literal out of range for f32

warnings per example, since two of the values in the example input are too large for a 32 bit IEEE 754 floating point number: 31.312e311 and -11.32e91. (Presumably, these were simply copied from the f64 examples.)

Using, for example, 31.312e31 and -11.32e19 instead, will fix this issue (though that may be considered confusingly close to the f64 examples, with a potential copy-paste regression waiting to happen).