Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Siemens PLM Community
- NX Manufacturing
- Discussion Forum - NX Manufacturing
- Why does post builder come up with such "strange" ...

Options

- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Why does post builder come up with such "strange" numbers?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-13-2016 02:30 PM

A link to this site was posted in the customization & programming forum, but as it comes up periodially in relation to posting, I thought I'd post it here as well.

If you've ever wondered why post builder comes up with a value of "0.75000000000000044" (instead of "0.75000000000000000" or (more interestingly) "1.96499999999999990" instead of "1.96500000000000000", you might want to read thru this web site:

I'm sure there's a wiki out there somewhere as well...

Ken

Production:NX10.0.3.5 MP16/TC11.2

I'd rather be e-steamed than e-diseaseled

4 REPLIES 4

Re: Why does post builder come up with such "strange" numbers?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-13-2016 03:56 PM

XKCD had me loling

Re: Why does post builder come up with such "strange" numbers?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-13-2016 02:25 AM

*EQ_is_zero* and *EQ_is_equal* in Postbuilder, because any floating mathematics has a precision inside some tolerance.

Re: Why does post builder come up with such "strange" numbers?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-08-2017 02:38 PM

Hi FROBI,

I am trying to understand what EQ_is_equal does after I found it being used to compare two variables. Does it choose a specific precision? Is there a good source available to learn about this command?

Thank you,

Jesse

Re: Why does post builder come up with such "strange" numbers?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-08-2017 02:53 PM

Precision which is used by EQ_is_equal is defined by **mom_system_tolerance**

As an alternative, you can also use EQ_is_equal_tol, where you can define what value of precision you want to use.

You can see source code of EQ_is_equal and others in this file:

(...)\MACH\resource\postprocessor\ugpost_base_math.tcl

proc EQ_is_zero [list s [list tol $mom_system_tolerance]] { expr { abs($s) <= $tol } } proc EQ_is_equal [list s t [list tol $mom_system_tolerance]] { expr { abs($s - $t) <= $tol } } proc EQ_is_ge [list s t [list tol $mom_system_tolerance]] { expr { $s > ($t - $tol) } } proc EQ_is_gt [list s t [list tol $mom_system_tolerance]] { expr { $s > ($t + $tol) } } proc EQ_is_le [list s t [list tol $mom_system_tolerance]] { expr { $s < ($t + $tol) } } proc EQ_is_lt [list s t [list tol $mom_system_tolerance]] { expr { $s < ($t - $tol) } } proc EQ_is_zero_tol { s tol } { expr { abs($s) <= $tol } } proc EQ_is_equal_tol { s t tol } { expr { abs($s - $t) <= $tol } }

**Learning Advantage** Learn NX CAM online at your own pace (Login required)

**Manufacturing Tutorials**

Already have NX CAM installed? Get hands-on with the in-software tutorials

**Product Support**

Contact Global Technical Access Center (GTAC)

Follow Siemens PLM Software

© 2019 Siemens Product Lifecycle Management Software Inc