Grasshopper

generative modeling for Rhino

# Minimum value which "Floating point value" can handle

I was wondering what is the minimum "Floating point value" Grasshopper can handle?

-1 x 10^-6 ?

I noticed Panel (String) can handle values lower than this, so maybe this handicap of not being able to type in the values less than -1 x 10^-6 in "Floating point value", can be bypassed by multiplying this value with another -1 x 10^-6. That way I will get -1 x 10^-12, right? And so on, and so on?

What is the minimum "Floating point value" Panel (String) can take?

Thank you.

Views: 190

### Replies to This Discussion

```4.94065645841247 x 10-324

Also known as System.Double.Epsilon. Grasshopper uses standard IEEE 754 compliant double precision floating point values. In the interface floating point numbers are often rounded to 6 decimal places, but that's only display, internally the values are not clipped or rounded.

--
David Rutten
david@mcneel.com

Thank you David.

Maybe the next improvement for the Grasshopper could be increase of decimal numbers for "Floating point value" at Number slider.

Currently it can handle only 6.

Can I ask what you need this accuracy for?

--

David Rutten

david@mcneel.com

It's part of my thesis.

There is a non dimensional factor in it, which uses quite small values up to 1 x 10^-70.

May sound strange but the further process of calculation depends on this value.

So you want the slider to go from 1e-70 to 1e-68? I assume you don't want to see all the decimals involved, as that would result in non-readable UI:

0.00000000000000000000000000000000000000000000000000000000000000000001 to 0.0000000000000000000000000000000000000000000000000000000000000000000001

These numbers pretty much have to be represented in scientific notation, or you need to decouple the coefficient and the exponent into two separate slider/dials/tumblers.

--

David Rutten

david@mcneel.com

Apart from all the readability, value dynamics is the real problem:

a) you want to modify a value from say 1*10^-70 to 1*10^-69. You can do so with a slider from 0.0 to 10.0 and simply mulitply it with 10^-70. (You should still keep in mind, that double floats have a quite limited capacity of about 16 decimals. Also, floating point operations with very small or hugely differing range tend to create denormalized numbers, which have HUGE performance impact over normal numbers.)

b) you want to represent a value with large dynamics, like sound pressure ranges from 2*10^-5 Pa to about 1 Pa. Using a GUI-SLider, you'll loose resoution anyway, so you could express this value in log-scale, dramatically shrinking the value range (0 to 140dB for sound pressure), still giving you acceptable resolution for small numbers.

Thank you for the reply, both of you.

What you need to have in mind,  is that I am still beginner in all this Grasshopper thing.

I need to input very small values, and I though that the only way to do that, was to use number sliders.

Now I see that I can also use the Panel(string) and just type in the needed number in it: for example 1e-6 instead of using the number slider and setting it's value to 0.000001.

btw, I noticed a strange thing - after copying sliders which have very small values (like 0.000001) or even after closing those .gh files, the sliders for some unknown reason reset to 0.000000

I do not know why.

Just so that you are aware Panels are strings which means that there is a slight overhead in converting them to numbers. But they do have the advantage that you can see what the value is and change it pretty easily.

The alternative is to use a Number Param from the Param Tab > Primitive Panel. Right Click on the component to set the number in the context menu.

Ok, I tried Number parameters and it worked, perfectly, thank you.

Can you just be a bit more precise when you said: "Panels are strings which means that there is a slight overhead in converting them to numbers."

Thank you.

Strings --> Number conversion takes time.

For one value you will not notice any difference in how long the definition takes to compute for thousands of values you might.

in a panel you have a list of characters

1

.

2

5

e

-

7

this list has to parsed in order for grasshopper to realise what you actually intended was 0.00000125. fractions of a second in real time but it all adds up.

So it is better (or so to say: faster) to use the Number parameters instead of Panels?

by 筑梦NARUTO

• View All

## Videos

• ### GH- AEC Metric PRO the Wall and Slab components WIP 002

Added by Andres Gonzalez