Rounding [Software]

posted by ElMaestro  – Denmark, 2013-01-02 17:12 (4508 d 12:47 ago) – Posting: # 9778
Views: 12,865

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,670 registered users;
276 visitors (0 registered, 276 guests [including 7 identified bots]).
Forum time: 07:00 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