Rounding [Software]

posted by ElMaestro  – Denmark, 2013-01-02 17:12 (4560 d 00:23 ago) – Posting: # 9778
Views: 13,199

Hi HS,

❝ @ElMaestro: Do you round in C?


Yes, I gave it some thought in C. Perhaps a little oddly, but in the C standard C will round down for integers (i.e. if you convert 125.8 to an integer the standard will be to tell you the result is 125). For recent sims I therefore need to make sure that the compiler does not convert to integers before the comparison with 125 or 80 is done. This is done e.g. by comparison with a true double precision figure like 80.00 rather than 80.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,687 registered users;
34 visitors (0 registered, 34 guests [including 8 identified bots]).
Forum time: 18: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