mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Avoid floating point precision errors in -p option
This commit is contained in:
parent
ecce8b136c
commit
e17bb92f69
1 changed files with 2 additions and 1 deletions
|
|
@ -1103,7 +1103,8 @@ int snapraid_main(int argc, char* argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
plan100 = plan_double * 100;
|
||||
/* +0.5 avoids floating point precision error of strtod, like "0.7" -> 0.6999... -> 0.6 */
|
||||
plan100 = plan_double * 100 + 0.5;
|
||||
}
|
||||
break;
|
||||
case 'o' :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue