On 08.01.2017 14:05, Ryan Joseph wrote:
> 
>> On Jan 8, 2017, at 7:54 PM, Sven Barth <pascaldra...@googlemail.com> wrote:
>>
>> Ehm, right. Add the Math unit, it contains an operator overload for
>> floating points. Alternatively you can use (also from the Math unit) the
>> FMod() function.
> 
> Hmmm, adding Math didn’t help and the FMod function is not found even. 
> http://www.freepascal.org/docs-html/rtl/math/index-5.html doesn’t show this 
> function exists either.

Ah, my bad. That's a recent addition in trunk (I tested with trunk).
However you can simply use the implementation from the commit for your
own code (see here:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/math.pp?r1=33130&r2=34968
)

> I thought (int)x was just type casting and didn’t actually transform the 
> number. That’s confusing.

Well, it's the same in C++...

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to