Tested versions
- Reproducible in: v4.4.1.stable.official [49a5bc7], v4.4.stable.custom_build [4c311cb]
System information
Godot v4.4.1.stable - Debian GNU/Linux 13 (trixie) 13 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce MX150 (nvidia) - Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 threads)
Issue description
When setting an exported float variable to a small value via the editor it gets rounded down to 0.0. This happens even when the Default Float Step would allow for such small increments to be entered.
Steps to reproduce
- Set the Default Float Step (Editor / Editor Settings... / Interface / Inspector / Default Float Step) to 0.000001 (that is 1×10^-6).
- Attach a script to a Node.
- Enter the following line:
@export var f: float
- Set the value of
f to 0.000001 through the editor.
- Observe how when hovering over it, it shows as 0.00000099999306. (What format is this? IEEE 754 32-bit and 64-bit formats store 0.0000009999999974752427078783512115478515625 and 0.000000999999999999999954748111825886258685613938723690807819366455078125 respectively)
- Run the scene. The value of
f can be checked via the following lines:
print_debug(f) and print_debug(f == 0.0)
They return 0.0 and true respectively.
This is unexpected. I would expect 0.000001 or 0.00000099999306 and false respectively.
Additional steps to verify that it only happens to values set via the inspector:
- Enter the following line
var g: float = 0.000001.
- Check the value of
g via the following lines:
print_debug(g) and print_debug(g == 0.0)
They return "0.00001" and "false" respectively.
This shows that the rounding happens to values set through the inspector.
Minimal reproduction project (MRP)
Bug.zip
Note that when editing the file Node.tscn, the line f = 0.000001 is nowhere to be seen.
Tested versions
System information
Godot v4.4.1.stable - Debian GNU/Linux 13 (trixie) 13 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce MX150 (nvidia) - Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 threads)
Issue description
When setting an exported float variable to a small value via the editor it gets rounded down to 0.0. This happens even when the Default Float Step would allow for such small increments to be entered.
Steps to reproduce
@export var f: floatfto 0.000001 through the editor.fcan be checked via the following lines:print_debug(f)andprint_debug(f == 0.0)They return
0.0andtruerespectively.This is unexpected. I would expect
0.000001or0.00000099999306andfalserespectively.Additional steps to verify that it only happens to values set via the inspector:
var g: float = 0.000001.gvia the following lines:print_debug(g)andprint_debug(g == 0.0)They return "0.00001" and "false" respectively.
This shows that the rounding happens to values set through the inspector.
Minimal reproduction project (MRP)
Bug.zip
Note that when editing the file Node.tscn, the line f = 0.000001 is nowhere to be seen.