Re: [ID 20010723.001] perl 5.6.1: BigInt booleans cannot handle
by other posts by this author
Jul 24 2001 5:22PM messages near this date
RE: [ID 20010723.001] perl 5.6.1: BigInt booleans cannot handle
|
Re: [ID 20010723.001] perl 5.6.1: BigInt booleans cannot handle
"Miller, Scott L" <Scott.L.Miller@[...].com> wrote:
:> From: Nicholas Clark [mailto:nick@[...].org]
:> Not sure if this is a sane idea. Can you
:>
:> define the width of a negative integer to be the smallest
:> number of bits
:> needed to represent it in 2s complement.
[...]
:How would you be able to tell if the number was intended to be negative?
:11010 = -6 or 26, 10111 = -9 or 23...
You always know from looking at the arguments: define sgn(x) as 0 for
positive and 1 for negative, and sgn(result) = sgn(left) op sgn(right)
does the right thing.
Hugo
Thread:
Miller, Scott L
John Peacock
|