I have a real number and i want to turn it into a interger is there a
command of procedure i cant find anything that helps.
Ben
ps
what i'm doing wrong
For Count:=1 to 200 do
Disp.Canvas.Lineto ( (Count * 2) + 10 , ((Sin (E1 * Pi * Count / 200)* 300)
+ 20) );
The second coordinate is real needs to be an integer!
>I have a real number and i want to turn it into a interger is there a
>command of procedure i cant find anything that helps.
The function you're looking for is "trunc". From the (D6) help file...
function Trunc(X: Extended): Int64;
Description
The Trunc function truncates a real-type value to an integer-type
value. X is a real-type expression. Trunc returns an Int64 value that
is the value of X rounded toward zero.
--
Kobayashi Software
www.kobayashi.com
I would buy you a drink!
"Ben Peachey" <Talb...@btopenworld.com> wrote in message
news:a8pc9q$s4a$1...@helle.btinternet.com...
>The second coordinate is real needs to be an integer!
Trunc() truncates to an integer, Round() rounds to the nearest
integer. Here round would be more accurate.