Rounding [Software]

posted by Helmut Homepage – Vienna, Austria, 2013-01-01 17:51 (4509 d 13:57 ago) – Posting: # 9773
Views: 14,307

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,671 registered users;
221 visitors (0 registered, 221 guests [including 14 identified bots]).
Forum time: 08:49 CEST (Europe/Vienna)

Young man, in mathematics you don’t understand things.
You just get used to them.    John von Neumann

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