How to remove alot of small numbers in rotation?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vania23

So i have a node which should rotate into specific rotation which is gotten from another node. But for some reason node what rotates into specific rotation gets additional small numbers like 0.00000001192093 or 0.00000002384186 , you got it. I have no idea how they got here but they are ruining my system for specification of rotation (it is down below)

even snapping the rotation to 0.05 does not help. Any idea to fix this? thank you

	if  $Head.rotation < snapped($look.rotation,0.05):
		$Head.rotate(0.05)
	elif $Head.rotation > snapped($look.rotation,0.05):
		$Head.rotate(-0.05)

If you work with floats you will always have that kind of inaccuracies.

https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate

Enfyna | 2023-04-02 14:33

:bust_in_silhouette: Reply From: Cyber-Kun

are you setting the rotation with gdscript or trying to rotate the object in the editor/game itself?