FreeCAD / FreeCAD/FreeCAD

Expressions: Incorrect results for values ​​over 10 digits (max. 32-bit int issue)

Open
#23,419 11 comments 0 reactions 0 assignees View on GitHub
Mod: Core no-auto-close Status: Confirmed Topic: Expressions Type: Bug Type: Known issue
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 15h
Merged PRs (30d)
196

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Problem description

I noticed this problem in the floating point values ​​varset. Maybe the problem manifests itself somewhere else.

If you enter 10 digits - the expression result is correct.
If you enter 11 or more digits - the expression returns a negative value.

See GIF

![Image](https://github.com/user-attachments/assets/eca4193b-f805-422a-99f3-0953eed58440)

It seems to be related to the character limit. I can't enter more than 10 characters inside a property. But I can do it inside an expression.

Why 10 characters and not 20? And if I need the number 12000054321? What to do in this case? )))

At the same time
![Image](https://github.com/user-attachments/assets/2f7f7b52-c5b6-4243-82f2-d2d34e3e0c71)

But
![Image](https://github.com/user-attachments/assets/e31b077f-7446-43dd-a661-19e5737e520f)

in general, maybe 10-15 characters should be enough. But then the limit EVERYWHERE should be the same. Otherwise, there is a chance that the user will relax and accidentally not notice the incorrect result.

### Full version info

```shell
OS: Manjaro Linux (KDE/plasma/xcb)
Architecture: x86_64
Version: 1.1.0dev.14555 (Git shallow) AppImage
Build date: 2025/08/26 20:37:46
Build type: Release
Branch: main
Hash: a5b3a2caac8feb34070415b637b5fbc2a3043a48
Python 3.11.13, Qt 6.8.3, Coin 4.0.3, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.2, OCC 7.8.1
Locale: Russian/Russia (ru_RU)
Navigation Style/Orbit Style/Rotation Mode: Revit/Turntable/Drag at cursor
Stylesheet/Theme/QtStyle: OpenLight.qss/OpenLight/
Logical DPI/Physical DPI/Pixel Ratio: 96/91.7938/1
Installed mods:
* Curves.backup1751366017.4487264 (Disabled)
* addFC-main 1.6.2
* Reinforcement
* Curves.backup1751365993.7542331 0.6.63 (Disabled)
* SvgWorkbench-main 1.0.0.dev5
* PitchedRoof
* LyapinWorkbrench
* FreeCAD_SketchArch-master
* FrameForge 0.1.3
* Curves.backup1751366131.5540717 (Disabled)
* Road 2025.2.22
* PitchedRoof.zip
* Curves 0.6.64
* freecad.gears 1.3.0
* sheetmetal 0.7.24
* OpenTheme 2025.5.20
```

### Subproject(s) affected?

Expressions

### Anything else?

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.