scale: round halfway away from zero
This commit is contained in:
parent
fa7c2a02d0
commit
9c88dfd784
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ impl Scale {
|
|||
return v;
|
||||
}
|
||||
let scale = self.0 as i64;
|
||||
v.map(|v| ((v as i64 * scale + BASE64 / 2) / BASE64) as i32)
|
||||
v.map(|v| ((v as i64 * scale + v.signum() as i64 * BASE64 / 2) / BASE64) as i32)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue