Ultimaker / CuraEngine

Powerful, fast and robust engine for converting 3D models into g-code instructions for 3D printers. It is part of the larger open source project Cura.
https://ultimaker.com/en/products/cura-software
GNU Affero General Public License v3.0
1.67k stars 880 forks source link

Round some results to nearest int instead of truncating #1914

Closed onitake closed 1 year ago

onitake commented 1 year ago

Description

This PR fixes the rounding errors on 32-bit Intel CPUs that were originally reported against 4.4 , but are still present in 5.x.

Fixes: #1192 For the rationale and discussion, please refer to this issue.

There are probably more places in the source where rounding the results properly will make sense, but this patch will at least fix all the unit tests that currently fail on the x87 FPU. Even if it isn't merged, it may still be useful as a future reference when optimizing and refactoring the core.

Type of change

How Has This Been Tested?

Test Configuration:

Checklist:

onitake commented 1 year ago

Thanks for merging! :+1:

Some additional information about what impact is expected from the patch: