develooper Front page | perl.perl5.porters | Postings from June 2021

Re: quadmath with 32 bit ints

Thread Previous | Thread Next
From:
Peter John Acklam
Date:
June 15, 2021 09:06
Subject:
Re: quadmath with 32 bit ints
Message ID:
CAEvoY41_hLsOV8tH_EXCJdnhDUTmcO1BmA33u7-Ohdhb--2TbQ@mail.gmail.com
lør. 12. jun. 2021 kl. 14:44 skrev sisyphus <sisyphus359@gmail.com>:
>
> This is not making sense to me.
> If a perl whose ivsize == 4 && nvsize == 8 determines that  (2**53 - 1) % 2 == 1 then, by extrapolation:
> 1)  a perl whose ivsize == 4 && nvsize == 12 should determine that  (2** 64 - 1) % 2 == 1
> &&
> 2) a perl whose ivsize == 4 && nvsize == 16 should determine that  (2** 113 - 1) % 2 == 1
>
> But points 1) and 2) are not being met.
> Am I missing something ?

Just for fun I compiled Perl 5.32.1 with ivsize == 4 and nvsize == 16
on a Solaris 10 host. I get the same result, i.e., (2**112-1) % 2 is
1, but (2**113-1) % 2 is 0. I also get that POSIX::fmod(2**113, 2) is
1.

Peter

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About