Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround Fan PercentSetting floating point precision error after "c…
…eil()" (#27912) * Workaround Fan Percent Setting floating point err Workaround floating point precision error which will cause invalid value after ceil() For example, the current value: speedMax: 10 percent: 70 speedMax * (percent * 0.01) = 7.000000000000001 (floating point precision error) ceil(speedMax * (percent * 0.01)) = 8 => The error propagate to ceil and cause the final result error. * Restyled by clang-format * Workaround Fan PercentSetting float error (2nd) Use integer multiply & devide to workaround floating point precision error which causes incorrect Fan PercentSetting value after ceil calculation. * Update src/app/clusters/fan-control-server/fan-control-server.cpp Co-authored-by: Boris Zbarsky <[email protected]> --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
- Loading branch information