mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-10 13:44:15 +00:00
Fix consistency in output
This commit is contained in:
parent
330b12e0ab
commit
038b85ce7a
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,8 @@ fn to_string(rational: &Mpq) -> (bool, String) {
|
|||
let placed_ints = n >= intdigits;
|
||||
let bail =
|
||||
(exact && (placed_ints || use_sci)) ||
|
||||
(n-zeros > 6 && use_sci) ||
|
||||
n as i32 - zeros.saturating_sub(1) as i32 + 1 > ::std::cmp::max(intdigits as i32, 6);
|
||||
(n as i32 - zeros as i32 > 6 && use_sci) ||
|
||||
n as i32 - zeros as i32 > ::std::cmp::max(intdigits as i32, 6);
|
||||
if bail && use_sci {
|
||||
// scientific notation
|
||||
buf = buf[zeros as usize + placed_decimal as usize + sign as usize..].to_owned();
|
||||
|
|
Loading…
Reference in a new issue