http://qs1969.pair.com?node_id=11108843


in reply to Re^6: Can I access and use UV types from perl?
in thread Can I access and use UV types from perl?

Sorry, I'm afraid I don't follow... but since you mention the high bit, note how in two's complement, the high bit is basically the sign bit. And the other nice thing is that the binary math still works well:

Of course, there are still overflow issues, e.g. 7+1 turns out as -8, but those will always happen with any fixed number of bits. Of course, the advantage of Perl's scalars here is that they will upgrade themselves automatically! (At the risk of losing some precision)