change to float tests
This commit is contained in:
parent
a65eef3609
commit
9b3dde66bd
@ -17,9 +17,9 @@ fn to_f32(){
|
|||||||
let a=I256F256::from(0);
|
let a=I256F256::from(0);
|
||||||
let f:f32=(-a).into();
|
let f:f32=(-a).into();
|
||||||
assert_eq!(f,0f32);
|
assert_eq!(f,0f32);
|
||||||
let a=I256F256::from(237946589723468975i64)<<32;
|
let a=I256F256::from(237946589723468975i64)<<16;
|
||||||
let f:f32=a.into();
|
let f:f32=a.into();
|
||||||
assert_eq!(f,237946589723468975f32*2.0f32.powi(32));
|
assert_eq!(f,237946589723468975f32*2.0f32.powi(16));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -32,9 +32,9 @@ fn to_f64(){
|
|||||||
let a=I256F256::from(0);
|
let a=I256F256::from(0);
|
||||||
let f:f64=(-a).into();
|
let f:f64=(-a).into();
|
||||||
assert_eq!(f,0f64);
|
assert_eq!(f,0f64);
|
||||||
let a=I256F256::from(237946589723468975i64)<<32;
|
let a=I256F256::from(237946589723468975i64)<<16;
|
||||||
let f:f64=a.into();
|
let f:f64=a.into();
|
||||||
assert_eq!(f,237946589723468975f64*2.0f64.powi(32));
|
assert_eq!(f,237946589723468975f64*2.0f64.powi(16));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user