Comment how the significand limits lossless int->float conversion
This commit is contained in:
parent
00d8d7bc04
commit
1a19f9877a
1 changed files with 4 additions and 0 deletions
|
@ -1515,6 +1515,10 @@ impl_from! { u16, i32 }
|
|||
impl_from! { u16, i64 }
|
||||
impl_from! { u32, i64 }
|
||||
|
||||
// Note: integers can only be represented with full precision in a float if
|
||||
// they fit in the significand, which is 24 bits in f32 and 53 bits in f64.
|
||||
// Lossy float conversions are not implemented at this time.
|
||||
|
||||
// Signed -> Float
|
||||
impl_from! { i8, f32 }
|
||||
impl_from! { i8, f64 }
|
||||
|
|
Loading…
Reference in a new issue