Rounding [Software]

posted by ElMaestro  – Denmark, 2013-01-02 17:12 (4922 d 19:39 ago) – Posting: # 9778
Views: 15,349

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,655 posts in 4,993 threads, 1,570 registered users;
360 visitors (0 registered, 360 guests [including 24 identified bots]).
Forum time: 13:51 CEST (Europe/Vienna)

Ignorance more frequently begets confidence
than does knowledge.    Charles Darwin

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