Notifications
Clear all

[Closed] Forcing almost zero values to be zero

I have an object whose local position is shown to be [0,0,0]
but when accessed by script I get [9.05991e-006,2.86102e-006,1.3262e-005]

superflous for my purposes, why not just give me zero?
does max have a method for this
or must I iterate through the X,Y,Z values testing for “almost zero”?

or better yet is there a way to get max to limit the precision somehow, so I don’t get results beyond, say 4 decimal points ?

2 Replies

Short answer: distance [0,0,0] obj.pos < eps
Long answer: Comparing float values (shameful selfpromo)

Hey SwordSlayer,

That’s a great article! Thanks for sharing.