# Rounding

## Recommended Posts

Hello,

i have found unexpexted rounding effects with the function "Round to nearest integer"

Input 0.5

output 0

Input 1.5

output 2

Input 2.5

Output 2

Input 3.5

Output 3

Labview is alwas rounding to a even integer.... but why?

What is the sense of these implementation of auf Rounding alghorithm?

Thanx

Claude

##### Share on other sites

This is standard behavior and noted in the help. I've just written a wiki article on rounding.

Ton

##### Share on other sites

QUOTE (Cloedu @ Aug 25 2008, 12:00 PM)

Labview is alwas rounding to a even integer.... but why?
Hi,

as far as I remember this had to do with statistics,

assume you have a big pile of points and they all get rounded up when ending on .5,

you end up with a higher average,

with this statistical rounding, the average would not change that much.

I hope this helps a bit

edit: Ton was a bit quicker in typing as me...

##### Share on other sites

QUOTE (Cloedu @ Aug 25 2008, 06:00 PM)

i have found unexpexted rounding effects with the function "Round to nearest integer"

Thats how I was taught in school.

##### Share on other sites

QUOTE (Cloedu @ Aug 25 2008, 06:00 AM)

Hello,

Labview is alwas rounding to a even integer.... but why?

What is the sense of these implementation of auf Rounding alghorithm?

Thanx

Claude

LabVIEW follows IEEE standard

round up the odd whole numbers ending with .5,

round down even numbers ending with .5.

From message by

Lew Drake

Process Automation Corporation, and the info LabVIEW mailing list, 4/12/07.

This method accumulates less error over time, it is statistically defensible. If you look around on line you will find detailed explanations, no problem.

##### Share on other sites

If you want to implement common rounding, you can do this by adding 0.5 and then rounding down. Here's an example.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

×