Don’t get tricked by Double Precision

There are plenty of good posts like these about the accuracy of numbers in Revit.

Without repeating the content of those posts, I will provide this reminder that even if you think a number will be 1, 0, -1, etc. it may be just slightly larger or smaller. And when you are debugging you might look at the value below for pf.Normal and think the Z value is exactly 0 and the surface is pointing exactly to the side.

Capture

 

But that would be a mistake, because the actual value of the Z value is not 0, as shown above.

Advertisements

One thought on “Don’t get tricked by Double Precision

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s