1
0
Fork 0
forked from wry/wry

ei: add support for libei

This commit is contained in:
Julian Orth 2024-07-24 01:38:05 +02:00
parent 084fe50259
commit 40e87f8f91
69 changed files with 4340 additions and 72 deletions

View file

@ -19,10 +19,18 @@ impl Fixed {
Self((f * 256.0) as i32)
}
pub fn from_f32(f: f32) -> Self {
Self::from_f64(f as f64)
}
pub fn to_f64(self) -> f64 {
self.0 as f64 / 256.0
}
pub fn to_f32(self) -> f32 {
self.0 as f32 / 256.0
}
pub fn from_1616(i: i32) -> Self {
Self(i >> 8)
}