×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Boolean Bug? V12

Boolean Bug? V12

Boolean Bug? V12

(OP)
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?

RE: Boolean Bug? V12

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources