*Expert Elite*
Posts: 6,207
Registered: ‎11-18-2006
Message 1 of 3 (117 Views)

# Expression Bug

117 Views, 2 Replies
02-28-2009 07:47 AM
Anyone ever noticed this?

Assume we have a point with elevation 1234.56.

Using this expression:

{Point Elevation}-(TRUNC({Point Elevation}/100)*100)

returns a result of 34.56.

But using *this* mathematically-identical expression:

{Point Elevation}-(100*TRUNC({Point Elevation}/100))

returns a value of 1134.56.

(Tested in C3D 2008 & 2009.)

-- Sinc
http://www.ejsurveying.com
http://www.quuxsoft.com
Sinc
*Jeff Mishler
Message 2 of 3 (117 Views)

# Re: Expression Bug

02-28-2009 09:06 AM in reply to: Sinc

Yes, I've seen this before with other expressions. It seems like the
Expression evaluator expects things in a certain order, mix that order up and
just the first item is evaluated.

Attached is a pic showing the results that you've discovered.

Whenever I create an expression now, I make sure to double & triple
check the results before accepting it for use.

style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Anyone
ever noticed this? Assume we have a point with elevation 1234.56. Using this
expression: {Point Elevation}-(TRUNC({Point Elevation}/100)*100) returns a
result of 34.56. But using *this* mathematically-identical expression: {Point
Elevation}-(100*TRUNC({Point Elevation}/100)) returns a value of 1134.56.
(Tested in C3D 2008 & 2009.) -- Sinc http://www.ejsurveying.com
http://www.quuxsoft.com
Employee
Posts: 2,882
Registered: ‎05-13-2005
Message 3 of 3 (117 Views)

# Re: Expression Bug

03-01-2009 08:05 PM in reply to: Sinc
Yes, expressions have returned odd results based on the order of operation. I haven't checked if that got fixed in v3.1 (sp2.1)

Matthew Anderson, PE
Global Services
Autodesk, Inc.

Recently Solved