Merge pull request #801 from mahkoh/jorth/negative-scaling
scale: round halfway away from zero
This commit is contained in:
commit
ec74723e40
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ impl Scale {
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
let scale = self.0 as i64;
|
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