Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Round to nearest even number

Status
Not open for further replies.

vinerunner

Aerospace
Sep 4, 2013
11
0
0
HU
Hi all!

I have the following question:

From an equation I get a number which is not round number but it's between 0-inf.
Let's say 81.321.

I would like to round this number to an even number.

So somehow like this: 81.321 -> 81 -> 82

The point is to get the "nearest" EVEN number.

My idea was that I'll use the floor function to make the rounded number but how can I make a number from that which is even for 100% sure?

Thanks!
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top