Rounding [Software]

posted by Helmut Homepage – Vienna, Austria, 2013-01-01 17:51 (4560 d 16:44 ago) – Posting: # 9773
Views: 14,689

Hi Simulators!

How does your software round? Mine:
Excel 2000:       round(125.005, 2) → 125.01
OO Calc:          round(125.005, 2) → 125.01
Gnumeric 1.10.16: round(125.005, 2) → 125.01
WinNonlin 5.3:    round(125.005, 2) → 125.01
Phoenix 6.3:      round(125.005, 2) → 125.01
JavaScript:       Math.round(125.005*100)/100 → 125.01
PHP:              round(125.005, 2) → 125.01
PHP ≥5.3.0:       round(125.005, 2, PHP_ROUND_HALF_UP) → 125.01
                  round(125.005, 2, PHP_ROUND_HALF_DOWN) → 125.00
                  round(125.005, 2, PHP_ROUND_HALF_EVEN) → 125.00
                  round(125.005, 2, PHP_ROUND_HALF_ODD) → 125.01
R 2.15.2:         round(125.005, 2) → 125.00

R claims to be compliant with IEC 60559. In normal life not sooo important, but in simulations. Example (106 sim’s, empiric alpha ~ T/R 1.25 in conventional balanced cross-overs).
n   CV   alpha        alpha
         no rounding  CI rounded
42  15%  0.049842     0.050746 (sig. >0.05)
36  17%  0.050010     0.050706 (sig. >0.05)


@ElMaestro: Do you round in C?

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,688 registered users;
92 visitors (0 registered, 92 guests [including 13 identified bots]).
Forum time: 11:35 CEST (Europe/Vienna)

Complex, statistically improbable things are by their nature
more difficult to explain than
simple, statistically probable things.    Richard Dawkins

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5