Hello,
I encountered a bug today and I find it great to report it as it can causes some trouble to users.
Description
Given a negative float value, if we try to cast it with the method .as_, so as_f64() for example, it returns 0 instead of the float value on 64 bits.
I tested it with as_f64(), as_f32() it works.
Example
let test : f64 = -10.0;
println!("Value : {}, casted value {}", test, test.as_f32());
It gives the output :
Value : -10, casted value 0
My guess is because there is a middle operation that casts the float to an unsigned integer, but I'm not sure.
Have a great day, and I hope this issue will be useful!!
Hello,
I encountered a bug today and I find it great to report it as it can causes some trouble to users.
Description
Given a negative float value, if we try to cast it with the method .as_, so as_f64() for example, it returns 0 instead of the float value on 64 bits.
I tested it with as_f64(), as_f32() it works.
Example
It gives the output :
My guess is because there is a middle operation that casts the float to an unsigned integer, but I'm not sure.
Have a great day, and I hope this issue will be useful!!