in reply to Applying Sign Bit
Mathmatically, zero is neither positive or negative. What you see is the result of Perl fudging a little.
Also, there is no "flag" value for negative numbers, at least not in the way you're probably thinking. See Twos-complement on Wikipedia. Although the concept is more complex than a simple flag value, it ends up simplifying the logic required for using signed numbers.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Applying Sign Bit
by Anonymous Monk on Jan 22, 2004 at 17:52 UTC | |
by demerphq (Chancellor) on Jan 23, 2004 at 19:48 UTC |