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

bit shifts and bigint

Thread Next
From:
Jarkko Hietaniemi
Date:
June 29, 2015 11:51
Subject:
bit shifts and bigint
Message ID:
5591313C.8030701@iki.fi
Now with b3498293..51f0b9cd the UV/IV behave as discussed

(1) negative shift is reverse shift

(2) overshift is zero

(3) ... or -1, when use integer and negative shiftee and right shift

but it seems that bigint behaves slightly differently:

(a) negative shift returns NaN (hi there, Merijn) BUT this
is NOT the numeric NaN or a string "NaN" but instead it is
the Math::BigInt NaN which behaves like the numeric NaN.

(b) shifting negatives returns negatives (assuming no overshift),
regardless of 'use integer', as opposed to the forced cast to UV
if no 'integer' and 'bigint'






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