Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Boolean Bug? V12

Status
Not open for further replies.

z3r0x

Civil/Environmental
Sep 28, 2005
2
Im having a hard time figuring out why MathCAD is giving me weird results on an if statement:

db:=25mm
cover:=75mm

b1:=if(cover<3*db,1.5,1.2) b1=1.5

i found 2 solutions to this bug:
- change db and cover to meters
- turn off "use exact equality for boolean comparisons"
in worksheet options.

when i do either, MathCAD displays the correct b1 value, that is 1.2.

this seems a pretty notorious bug, unless im doing something wrong.

MathCAD v12.0, Windows XP SP2.


Comments?

 
Replies continue below

Recommended for you

I've had similar errors crop up from time to time. Another solution is to write your if statement as:
b1:=if(cover<Round(3*db,1mm),1.5,1.2)
(be sure to capitalize Round to use with units)

You can email support@mathsoft.com with your worksheet to report this. I think when I sent them a similar problem a few years ago I got a response that said something like "Mcad's engine works with binary, and representing decimal numbers in binary can lead to very small errors..." So since then I look at my results carefully and make use of round statements liberally.

Also upgrade to v12.1, v12 is VERY, VERY buggy (not that v12.1 is great, but it is an improvement)

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor