Mail Archives: djgpp/1998/01/19/19:37:51
Something like
(int)((PI*sin(34)/43)+.5)
works for positive integers only, but I think
ceil(PI*sin(34)/43)
is part of the ANSI standard. You'll have to cast to an int, since ceil() returns a double.
Hope that helps.
In message <34c3be38 DOT 741112 AT nntpserver DOT swip DOT net>, radon AT swipnet DOT se (Rikard Björklind) wrote:
> I want to know how to assign a double value to an int. Like this for
> example:
>
> int hej = (PI*sin(34)/43);
>
> I want the value rounded. Please help me I'm a beginner =).
>
>
- Raw text -