Skip Menu |

This queue is for tickets about the Type-Tiny-XS CPAN distribution.

Report information
The Basics
Id: 98631
Status: resolved
Priority: 0/
Queue: Type-Tiny-XS

People
Owner: perl [...] toby.ink
Requestors: STEVENL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.010
Fixed in: (no value)



Subject: PositiveInt check is false for large ints
The following tests demonstrate the issue: use Test::More; use Types::Standard 'Int'; use Types::Common::Numeric 'PositiveInt'; ok( PositiveInt->check( 2 ** 30 ), 'positive int' ); # pass ok( PositiveInt->check( 2 ** 31 ), 'large positive int' ); # FAIL ok( Int->check( 2 ** 31 ), 'large int' ); # pass All of the tests will pass if I set PERL_TYPE_TINY_XS=0. I'm also using Type-Tiny 1.000004.
I use: i = SvIVx(sv); return ((i > 0) ? TRUE : FALSE); to check whether the integer is positive, which casts to the native integer type. Really I ought to cast to a string and check it doesn't start with a minus, and isn't 0.
Thanks; fixed in 0.011.