LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't understand numeric rounding-function

Solved!
Go to solution

Hi,

 

Does anybody know, why the rounding-function on the numeric palette and also the indexing-connector of the "index array"-function round "1,5" up to "2" and "2,5" down to "2".

I learned that a "5" after the comma will always be rounded up.

 

Lorand

0 Kudos
Message 1 of 3
(2,557 Views)

Ive had a quick look in the context help, it rounds the number to the nearest even integer. Bit odd, as you say .5 is normally rounded up, 

 

hope it helps 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 2 of 3
(2,552 Views)
Solution
Accepted by topic author Lorand

Hi Lorand,

 

this has been asked before and probably will be asked again...

 

But Wikipedia has the explanation: bankers' rounding is default for an IEEE754 implementation.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 3
(2,545 Views)