change to float tests

This commit is contained in:
Quaternions 2024-10-01 15:00:06 -07:00
parent a65eef3609
commit 9b3dde66bd

View File

@ -17,9 +17,9 @@ fn to_f32(){
let a=I256F256::from(0);
let f:f32=(-a).into();
assert_eq!(f,0f32);
let a=I256F256::from(237946589723468975i64)<<32;
let a=I256F256::from(237946589723468975i64)<<16;
let f:f32=a.into();
assert_eq!(f,237946589723468975f32*2.0f32.powi(32));
assert_eq!(f,237946589723468975f32*2.0f32.powi(16));
}
#[test]
@ -32,9 +32,9 @@ fn to_f64(){
let a=I256F256::from(0);
let f:f64=(-a).into();
assert_eq!(f,0f64);
let a=I256F256::from(237946589723468975i64)<<32;
let a=I256F256::from(237946589723468975i64)<<16;
let f:f64=a.into();
assert_eq!(f,237946589723468975f64*2.0f64.powi(32));
assert_eq!(f,237946589723468975f64*2.0f64.powi(16));
}
#[test]