Mail Archives: djgpp/1996/11/20/23:40:57
John M. Aldrich wrote:
>
> int auks;
> auks = floor( 19.99 + 11.99 );
Oops - I hate it when I do that. For maximum correctness, you need to
typecast the result of floor() to int here; otherwise you're just doing
the same thing that created the original problem. That should read:
int auks;
auks = (int) floor( 19.99 + 11.99 );
Of course, if you do that you may as well get rid of floor() and just
typecast the result. ;)
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| * Proud user of DJGPP! * | http://www.cs.com/fighteer |
| ObJoke: If Bill Gates were a robber, not only would he |
| shoot you, but he'd send you a bill for the bullets. |
---------------------------------------------------------------------
- Raw text -