Rounding [Software]
Hi HS,
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.
❝ @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
Pass or fail!
ElMaestro
Complete thread:
- Rounding Helmut 2013-01-01 16:51 [Software]
- Rounding d_labes 2013-01-02 12:51
- Rounding Helmut 2013-01-04 17:35
- Rounding d_labes 2013-01-05 19:25
- Rounding Helmut 2013-01-05 20:13
- Sim’s are sim’s are sim’s d_labes 2013-01-05 20:57
- Another vicious circle Helmut 2013-01-06 02:21
- Where all these numbers came from? d_labes 2013-01-07 15:52
- Flaw in the GL? Helmut 2013-01-07 17:29
- Flaw in the GL? d_labes 2013-01-08 11:44
- What a mess! Helmut 2013-01-08 19:08
- What a mess! d_labes 2013-01-09 10:33
- What a mess! Helmut 2013-01-09 15:18
- What a mess! d_labes 2013-01-09 10:33
- What a mess! Helmut 2013-01-08 19:08
- Flaw in the GL? d_labes 2013-01-08 11:44
- Flaw in the GL? Helmut 2013-01-07 17:29
- Where all these numbers came from? d_labes 2013-01-07 15:52
- Rounding Helmut 2013-01-05 20:13
- Rounding d_labes 2013-01-05 19:25
- Rounding Helmut 2013-01-04 17:35
- RoundingElMaestro 2013-01-02 16:12
- Abandon rounding Helmut 2013-01-02 17:04
- Rounding yjlee168 2013-01-05 23:15
- Rounding d_labes 2013-01-02 12:51