in reply to Re^3: History repeats: 128 bit Math:Bigint numbers in a 64 bit DBI world
in thread History repeats: 128 bit Math:Bigint numbers in a 64 bit DBI world

You guys have given the "correct" answer: I'm also convinced that Math::Int128 is the right way to go.

Math::Int128 *should* work on my install, but it does not.

perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x +64-multi-thread cpan Math::Int128 <snip> t/00-report-prereqs.t ..... ok t/author-eol.t ............ skipped: these tests are for testing by th +e author t/author-no-tabs.t ........ skipped: these tests are for testing by th +e author t/author-pod-spell.t ...... skipped: these tests are for testing by th +e author t/bugs.t .................. ok t/Math-Int128.t ........... 1/? # Failed test 'max int128 >> 95' # at t/Math-Int128.t line 174. # got: '4294967295' # expected: '1' # $max >> $j = 4294967295, $max / 2 ** $j = 1, $max = 1701411834604692 +3173168730 3715884105727, $j = 95, 2 ** $j = 39614081257132169000000000000.000000 +, int128(2 ** $j) = 39614081257132168796771975168 # Failed test 'max int128 >>= 95' # at t/Math-Int128.t line 183. # got: '4294967295' # expected: '1' t/Math-Int128.t ........... Dubious, test returned 148 (wstat 37888, 0 +x9400) Failed 2/785 subtests t/Math-UInt128.t .......... 1/? # Failed test 'max uint128 >> 95' # at t/Math-UInt128.t line 172. # got: '8589934591' # expected: '1' # Failed test 'max uint128 >>= 95' # at t/Math-UInt128.t line 176. # got: '8589934591' # expected: '1' <snip>
Obviously there are math overflows being triggered in the tests. I'll try another (later) version but there's some very old code on this box. Plus I need mod_perl2 and Apache2 which increases the dependencies. Not asking for sympathy. It's just how it is.

BTW pack ('Q', blah) and unpack ('Q',blah) which require 64 bit PERL, DOES work.

  • Comment on Re^4: History repeats: 128 bit Math:Bigint numbers in a 64 bit DBI world
  • Download Code

Replies are listed 'Best First'.
Re^5: History repeats: 128 bit Math:Bigint numbers in a 64 bit DBI world
by syphilis (Archbishop) on Jul 05, 2016 at 00:33 UTC
    There's a known bug with Strawberry 5.16.x builds - see line 179 of Math-Int128.t.
    I suspect you might have uncovered another bug with Strawberry 5.16.3.

    For my own MinGW builds of MSWin32-x64-multi-thread I find no problem with Math-Int128-0.22 going back to 5.12.0.

    Cheers,
    Rob
      Actually, it is the same bug. What is odd is that it doesn't trigger the check that follows in the test script.
Re^5: History repeats: 128 bit Math:Bigint numbers in a 64 bit DBI world
by BrowserUk (Patriarch) on Jul 04, 2016 at 14:06 UTC

    If you do 'make clean' and then 'makefile'; do you see this?:

    ... Checking for unsigned int __attribute__ ((__mode__ (DI)))... no Checking for uint64_t... (cached) no Checking for unsigned int __attribute__ ((__mode__ (DI)))... (cached) +no It looks like your compiler doesn't support a 128-bit integer type ( +one of "int __attribute__ ((__mode__ (TI)))" or "__int128"). One of these t +ypes is necessary to compile the Math::Int128 module.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.