in reply to Re^5: Can I access and use UV types from perl?
in thread Can I access and use UV types from perl?

well, and this may a little bit controversial, but...

#!perl use strict; use warnings; use Test::More tests => 1; my $x = 5; my $y = 3; is $x / $y, undef, 'Yes, your integers behave exactly as expected'; =head1 output 1..1 not ok 1 - yes your integers behave as expected # Failed test 'yes your integers behave as expected' # at -e line 1. # got: '1.66666666666667' # expected: undef # Looks like you failed 1 test of 1. =cut

Replies are listed 'Best First'.
Re^7: Can I access and use UV types from perl?
by AnomalousMonk (Archbishop) on Nov 18, 2019 at 01:50 UTC

    This is what I would tend to expect (using integer):

    c:\@Work\Perl\monks>perl -le "use strict; use warnings; ;; use integer; ;; use Test::More tests => 2; ;; my $x = 5; my $y = 3; ;; is $x / $y, 1, qq{$x / $y == 1 is expected}; is $y / $x, 0, qq{$y / $x == 0 is expected}; " 1..2 ok 1 - 5 / 3 == 1 is expected ok 2 - 3 / 5 == 0 is expected


    Give a man a fish:  <%-{-{-{-<

      You got me here, the documentation for the pragma does describe that expected behaviour.