Cloedu Posted August 26, 2008 Report Share Posted August 26, 2008 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 Quote Link to comment
LAVA 1.0 Content Posted August 26, 2008 Report Share Posted August 26, 2008 This is standard behavior and noted in the help. I've just written a wiki article on rounding. Ton Quote Link to comment
tnt Posted August 26, 2008 Report Share Posted August 26, 2008 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... Quote Link to comment
jgcode Posted August 26, 2008 Report Share Posted August 26, 2008 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. Quote Link to comment
mross Posted August 26, 2008 Report Share Posted August 26, 2008 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. Quote Link to comment
Yair Posted August 26, 2008 Report Share Posted August 26, 2008 If you want to implement common rounding, you can do this by adding 0.5 and then rounding down. Here's an example. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.