Jump to content
Sign in to follow this  
Cloedu

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.