27.04.2018 17:14, Sven Barth via fpc-devel wrote:
Thorsten Engler <thorsten.eng...@gmx.net <mailto:thorsten.eng...@gmx.net>> schrieb am Fr., 27. Apr. 2018, 16:09:

    Highest integer that fits in a Int64:____

    9223372036854775808____

    1e20:____

    100000000000000000000____

    __ __

    Your Int is overflowing.____

    __ __

    You can’t implement Frac by going through an Integer, that will never work. 
Except if you have
    an integer that can hold 1.8E308 (which would be a 1024 bit integer, or 
thereabouts)


Yes, I saw that now as well, though it's even worse as the cvttsd2si instruction in fact only works with 32-bit integers. That additionally means that Trunc() and Round() are broken for such values as well as they rely on the same kind of functions. Int() works because it doesn't have an SSE version.


That's true for i386. But on x86_64 cvt(t)sd2si instuctions can deal with int64 range, if destination register is a 64-bit one.

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

Reply via email to