algorithmic modeling for Rhino
I'm not 100% sure, but I think the two operate with slightly different tolerances. When I compare 4.0000000000001 and 4, the equality component says they are equal, and the function component says they are not. What values exactly are you giving?
If this is presenting a problem, you might take a look at the "near equality" operator in the function component - As I understand it it only compares up to 10 decimal places.
12 decimal places in fact, so yeah, this is probably a rounding artefact.
NEVER use equality on floating point values that come from different sources, always compute the difference and compare it to a tolerance you're happy with:
Abs(x-y) < 1e-8
--
David Rutten
david@mcneel.com
Poprad, Slovakia
The panel only shows is a string representation to 6 dp of that number.
And where can I see the whole number?
Is it a settings matter?
there are some numbers that cannot be shown in that sense think root 2 and PI they go on on
you might be able to force the issue with a format function in an fx component.
format("{0:0.00000000000000}",x)
Format("{0:R}", x)
The "R" stands for "Roundtrip", meaning the string representation of the number is guaranteed to be lossless. You may end up with a thoroughly unreadable bit of text though.
Format("{0:0.0###############}", x)
This formatting mask forces a single decimal, and allows for 15 more if they are significant. You can combine any number of "0"s and then "#"s to suit your needs.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by