Rounding [Software]

posted by Helmut Homepage – Vienna, Austria, 2013-01-01 17:51 (4513 d 01:46 ago) – Posting: # 9773
Views: 14,310

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,670 registered users;
116 visitors (0 registered, 116 guests [including 4 identified bots]).
Forum time: 20:38 CEST (Europe/Vienna)

Lack of clarity is always a sign of dishonesty.    Celia Green

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