Float comparsion

Is there defined any “minimal absolute” float value or should I use some my own? For example when I wan’t to check, if some float value is zero, should I use

if ( abs(float) < 0.00001)

or I should compare to some predefined variable?

How about:


round(n,7)

Isn’t this slower?

Looking at it, i’d say yes…

On another tack, I don’t know if there is a defined tolerance variable, however I did find out once that Blender is supposedly precise to 7 decimal places.

inside blender vars are limtied to 7 digits
but python’ vatrs are not it is always by default 16 digits i think!

unless you sue the specail module to increase signi digits to whatever you want
but math functions might be more difficult to find !

so depends what you are doing ?

happy 2.5

Thank you. So I will be happy with if (abs(something) < 0.000001)) …

I say abs is faster, but that’s thinking in ASM, I may set up a test later though… (since this is Python)