Initial Commit

This commit is contained in:
Riley Schneider
2025-12-03 16:38:10 +01:00
parent c5e26bf594
commit b732d8d4b5
17680 changed files with 5977495 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
package Math::Int64::die_on_overflow;
use strict;
use warnings;
use Math::Int64 ();
sub import {
require Math::Int64;
Math::Int64::_set_may_die_on_overflow(1);
$^H{'Math::Int64::die_on_overflow'} = 1;
goto &Math::Int64::_check_pragma_compatibility;
}
sub unimport {
undef $^H{'Math::Int64::die_on_overflow'}
}
1;
# ABSTRACT: catch overflows when using Math::Int64
__END__
=encoding UTF-8
=head1 NAME
Math::Int64::die_on_overflow - catch overflows when using Math::Int64
=head1 SYNOPSIS
use Math::Int64 qw(uint64);
use Math::Int64::die_on_overflow;
my $number = uint64(2**32);
say($number * $number); # overflow error!
=head1 SEE ALSO
L<Math::Int64>.
=cut

View File

@@ -0,0 +1,43 @@
package Math::Int64::native_if_available;
use strict;
use warnings;
use Math::Int64 ();
sub import {
if (Math::Int64::_backend() eq 'IV' and $] >= 5.008) {
Math::Int64::_set_may_use_native(1);
$^H{'Math::Int64::native_if_available'} = 1;
goto &Math::Int64::_check_pragma_compatibility;
}
}
sub unimport {
undef $^H{'Math::Int64::native_if_available'};
}
1;
# ABSTRACT: Use the native Perl 64-bit integer implementation when available
__END__
=encoding UTF-8
=head1 NAME
Math::Int64::native_if_available - Use the native Perl 64-bit integer implementation when available
=head1 SYNOPSIS
use Math::Int64 qw(uint64);
use Math::Int64::native_if_available;
=head1 SEE ALSO
L<Math::Int64>.
=cut