Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: supporting quads on 32 bit Perl (0.23)

by ikegami (Pope)
on Jun 04, 2012 at 17:35 UTC ( #974335=note: print w/ replies, xml ) Need Help??


in reply to supporting quads on 32 bit Perl

[ The thread was getting too deep. ]

The third test of MSC.t is failing for me.

  • Math-Int64-0.23
  • ActivePerl build 1402
  • Perl 5.14.2, 32 bit, threaded.
  • Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
t/MSC.t ................. 1/3 # Failed test 'uint64 to NV conversion 3' # at t/MSC.t line 15. # Looks like you failed 1 test of 3. t/MSC.t ................. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/3 subtests t/MSC.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 1

I changed the test from ok to is tests to get more info:

t/MSC.t ................. 1/3 # Failed test 'uint64 to NV conversion 3' # at t/MSC.t line 15. # got: '1.83746864796716e+019' # expected: '18374686479671623680' # Looks like you failed 1 test of 3.

The thing is I can't see any different between the two by looking at them using sprintf or pack 'd'.

nv: 1.837468647967162400000000000000e+019 u: 1.837468647967162400000000000000e+019 nv: 43efe00000000000 u: 43efe00000000000

The warnings I get:

Int64.xs(256) : warning C4244: 'return' : conversion from 'NV' to 'int +64_t', possible loss of data Int64.xs(335) : warning C4244: 'return' : conversion from 'NV' to 'uin +t64_t', possible loss of data Int64.xs(345) : warning C4244: 'initializing' : conversion from 'int64 +_t' to 'IV', possible loss of data Int64.xs(350) : warning C4244: 'initializing' : conversion from 'int64 +_t' to 'UV', possible loss of data Int64.xs(354) : warning C4244: 'function' : conversion from 'int64_t' +to 'const NV', possible loss of data Int64.xs(360) : warning C4244: 'initializing' : conversion from 'uint6 +4_t' to 'UV', possible loss of data Int64.xs(363) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const NV', possible loss of data Int64.xs(375) : warning C4244: 'initializing' : conversion from 'uint6 +4_t' to 'char', possible loss of data Int64.xs(492) : warning C4244: 'function' : conversion from 'int64_t' +to 'const IV', possible loss of data Int64.xs(516) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const UV', possible loss of data Int64.xs(535) : warning C4244: '=' : conversion from 'int64_t' to 'cha +r', possible loss of data Int64.xs(553) : warning C4244: '=' : conversion from 'uint64_t' to 'ch +ar', possible loss of data Int64.xs(669) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const IV', possible loss of data Int64.xs(680) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const UV', possible loss of data Int64.xs(690) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const IV', possible loss of data Int64.xs(700) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const UV', possible loss of data Int64.xs(712) : warning C4244: 'function' : conversion from 'int64_t' +to 'const IV', possible loss of data Int64.xs(723) : warning C4244: 'function' : conversion from 'uint64_t' + to 'const IV', possible loss of data Int64.c(1288) : warning C4101: 'rev' : unreferenced local variable Int64.c(1287) : warning C4101: 'other' : unreferenced local variable Int64.c(1317) : warning C4101: 'rev' : unreferenced local variable Int64.c(1316) : warning C4101: 'other' : unreferenced local variable Int64.c(1782) : warning C4101: 'rev' : unreferenced local variable Int64.c(1811) : warning C4101: 'rev' : unreferenced local variable Int64.c(2107) : warning C4101: 'rev' : unreferenced local variable Int64.c(2106) : warning C4101: 'other' : unreferenced local variable Int64.c(2133) : warning C4101: 'rev' : unreferenced local variable Int64.c(2132) : warning C4101: 'other' : unreferenced local variable Int64.c(2159) : warning C4101: 'rev' : unreferenced local variable Int64.c(2158) : warning C4101: 'other' : unreferenced local variable Int64.c(2185) : warning C4101: 'rev' : unreferenced local variable Int64.c(2184) : warning C4101: 'other' : unreferenced local variable Int64.c(2211) : warning C4101: 'rev' : unreferenced local variable Int64.c(2210) : warning C4101: 'other' : unreferenced local variable Int64.c(2237) : warning C4101: 'rev' : unreferenced local variable Int64.c(2236) : warning C4101: 'other' : unreferenced local variable Int64.c(2263) : warning C4101: 'rev' : unreferenced local variable Int64.c(2262) : warning C4101: 'other' : unreferenced local variable Int64.c(2289) : warning C4101: 'rev' : unreferenced local variable Int64.c(2288) : warning C4101: 'other' : unreferenced local variable Int64.c(2317) : warning C4101: 'rev' : unreferenced local variable Int64.c(2316) : warning C4101: 'other' : unreferenced local variable Int64.c(2763) : warning C4101: 'rev' : unreferenced local variable Int64.c(2792) : warning C4101: 'rev' : unreferenced local variable Int64.c(3088) : warning C4101: 'rev' : unreferenced local variable Int64.c(3087) : warning C4101: 'other' : unreferenced local variable Int64.c(3114) : warning C4101: 'rev' : unreferenced local variable Int64.c(3113) : warning C4101: 'other' : unreferenced local variable Int64.c(3140) : warning C4101: 'rev' : unreferenced local variable Int64.c(3139) : warning C4101: 'other' : unreferenced local variable Int64.c(3166) : warning C4101: 'rev' : unreferenced local variable Int64.c(3165) : warning C4101: 'other' : unreferenced local variable Int64.c(3192) : warning C4101: 'rev' : unreferenced local variable Int64.c(3191) : warning C4101: 'other' : unreferenced local variable Int64.c(3218) : warning C4101: 'rev' : unreferenced local variable Int64.c(3217) : warning C4101: 'other' : unreferenced local variable Int64.c(3244) : warning C4101: 'rev' : unreferenced local variable Int64.c(3243) : warning C4101: 'other' : unreferenced local variable ...\int64.xs(170) : warning C4715: 'SvSI64' : not all control paths re +turn a value ...\int64.xs(180) : warning C4715: 'SvSU64' : not all control paths re +turn a value


Comment on Re: supporting quads on 32 bit Perl (0.23)
Select or Download Code
Re^2: supporting quads on 32 bit Perl (0.23)
by salva (Abbot) on Jun 04, 2012 at 21:42 UTC
    The thing is I can't see any different between the two by looking at them using sprintf or pack 'd'.

    That's because sprintf and pack first convert the uint64 into an NV implicitly.

    On the other hand, is converts its operands into strings and compares them. The NV is represented in scientific notation and the uint64 in decimal and so they differ.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://974335]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-12-27 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls