Python Console and Tasks - Differences

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Python Console and Tasks - Differences

Post by renatorivo »

Draft -> Arc
When creating an arc, entering the data from the keyboard, the Tasks tab shows the correct data, the ones typed, instead the Python console shows slightly different values. It doesn't happen with all values.
Draft Arc.PNG
Draft Arc.PNG (58.84 KiB) Viewed 370 times
OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18629 (Git)
Build type: Release
Branch: master
Hash: bb1aec9e60faa8b279306bfebe672b8d4e77351d
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Python Console and Tasks - Differences

Post by openBrain »

Yep. This is due to floating point representation. ;)
You can find some good articles on the web about "floating point precision". ;)
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Python Console and Tasks - Differences

Post by renatorivo »

Not very clear since 0,9375*2 ↑6=60 not 59,999.., but if you say it's not a bug, that's fine.
Thanks
Post Reply