X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=xs-src%2FMouseTypeConstraints.xs;h=7068a5b4038fd95adbc1af0c9552584a750d2341;hp=a7ff3905bdc72d73d2834589d1dd8e3084306179;hb=9ab5eba8f47dea20ad51f8dccb18c574399748c9;hpb=1f1ccccdb5564d10867ffb11df17a5155999a62a diff --git a/xs-src/MouseTypeConstraints.xs b/xs-src/MouseTypeConstraints.xs index a7ff390..7068a5b 100644 --- a/xs-src/MouseTypeConstraints.xs +++ b/xs-src/MouseTypeConstraints.xs @@ -120,9 +120,14 @@ mouse_tc_Num(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { int mouse_tc_Int(pTHX_ SV* const data PERL_UNUSED_DECL, SV* const sv) { assert(sv); - if(SvIOKp(sv) || SvNOKp(sv)){ + if(SvIOKp(sv)){ return TRUE; } + else if(SvNOKp(sv)) { + NV const nv = SvNVX(sv); + NV mod = Perl_fmod( nv, 1 ); + return mod == 0; + } else if(SvPOKp(sv)){ int const num_type = grok_number(SvPVX(sv), SvCUR(sv), NULL); if(num_type){