Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unpredictable floor() !!!

Status
Not open for further replies.

man2007

Aerospace
Nov 6, 2007
283
I wrote following expressions

i=24
j=floor(i/12)

Surprisingly I got j=1 !!

To cross-check the result I created one more expression

k=floor(2)

which gave me k=2 !!

John, why floor() function is so unpredictable? I checked it in NX4 as well as in NX6.
 
Replies continue below

Recommended for you

OK, I've verified what's happening and it was something which I thought we had fully addressed a while back but apparently not. But let me ask you this, you're working in Imperial (AKA, English) units, correct?

Note that I will open a PR and will let you know what I learn.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
yes John, I am using Inch units only.
 
As a workaround, change the dimensionality of 'i' to 'Constant'. Irrespective of the units which you are working in, this will mitigate the problem and should not effect your other expressions. I know it's a pain, but hopefully we can get this fixed ASAP.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Thanks for your replies, and workaround.
 
OK, I just got a status on the PR I wrote. The fix will be in NX 6.0.3.x, which should be available around Mid-Year, perhaps a little before that.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Whether this will be fixed in NX4 too.
 
At this point in time, in order for any fix to to be a candidate for back-porting to NX 4, it would have to address something with a much larger impact than this issue has. I can say this for two reasons:

First, we've provided what we consider as being an acceptable workaround, that is using 'Constant' valued Expressions when utilizing either the Floor or Ceiling functions.

And second, the problem ONLY manifests itself when working in Imperial (English) units. And while I know that some here in the U.S. will not appreciate this, it's been estimated that something close to 80% of all NX licenses are being used by organizations who work exclusively in Metric units.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Cypress, CA

To an Engineer, the glass is twice as big as it needs to be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor