I use Delphi 5 and I dont know how to convert variables of type Extended to
other types, e.g. Integer.
I am sure it can be done, but Delphi 5 help is useless.
In my program I want to calculate mod between two variables of Extended
type. Can I do this in another way thaen converting these two variables to
integer and then do "a mod b"?
Thank you for your help,
Borut Zagar
Darius Blaszijk
Borut Zagar wrote in message <3929...@news.perftech.si>...
> I use Delphi 5 and I dont know how to convert variables of type Extended to
> other types, e.g. Integer.
> I am sure it can be done, but Delphi 5 help is useless.
> In my program I want to calculate mod between two variables of Extended
> type. Can I do this in another way thaen converting these two variables to
> integer and then do "a mod b"?
> Thank you for your help,
> Borut Zagar
Hi,
I would try it with an equation. As you probably know the mod operator can
be expressed as a mod b = a - a div b. So you can use the last statement to
express your mod operator on two Extended numbers. Just type
mod := a - Trunc(a / b);
Then you get your mod.
Good luck.
cu,
Toralf
mod := a - Int(a / b);
"Toralf Richter" <tr...@irz787.inf.tu-dresden.de> schreef in bericht
news:8ggnai$45o$1...@irz787.inf.tu-dresden.de...