×
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

"Floor" and "Ceil" in Relations

"Floor" and "Ceil" in Relations

"Floor" and "Ceil" in Relations

(OP)
The "floor" and "ceil" relations functions allow you to determine the value of a real number by setting it to its next higher integer or its base integer value. These are little known functions, but can be useful in extracting information.
As an example, the real number parameter "A" is set to 12.5405. In the Relations Editor, the following statements will yield the shown results:
*********
A=12.5405
B=floor(A)
A will be set to 12 (the next lower integer is 12)
*********
A=12.5405
B=ceil(A)
A will be set to 13 (the next higher integer is 13)
*********
A=12.5405
B=floor(A,2)
A will be set to 12.54
*********
A=12.5405
B=ceil(A,2)
A will be set to 12.55
*********
A=12.5405
B=floor(A,3)
A will be set to 12.54 (the "0" is not shown, even though 3 significant digits were indicated)
*********
A=-12.5405
B=ceil(A)
A will be set to -12
*********
A=-12.5405
B=floor(A)
A will be set to -13 (since -13 is "lower" than -12)

A practical example would be to determine the decimal value of a real number. In a part, if d1 equals 24.750, we can write a relation that returns the value after the decimal place.
**********
d1=25.750
DECIMAL=d1-floor(d1)

The DECIMAL parameter will evaluate to .750


Steve

http://www.3dlogix.com

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