in reply to vec overflow?
Is this a problem with vec? My Perl build? My syntax? Any workarounds?
It's a problem with vec. Internally it is using a signed 32-bit values, even on 64-bit builds.
One workaround I've used is to break the vector into subsections and use bitmasking to select the appropriate one:
@vecs = ( chr(0)x2**29 ) x 8;; $n = 2**31; vec( $vecs[ $n >> 29 ], $n & 0x1fffffff, 1 ) = 1;;
Not very satisfactory, but workable.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: vec overflow?
by Anonymous Monk on Jun 25, 2013 at 01:07 UTC | |
by BrowserUk (Patriarch) on Jun 25, 2013 at 01:34 UTC |