3 # Copyright 2001 Free Software Foundation, Inc.
5 # This file is part of the GNU MP Library.
7 # The GNU MP Library is free software; you can redistribute it and/or modify
8 # it under the terms of either:
10 # * the GNU Lesser General Public License as published by the Free
11 # Software Foundation; either version 3 of the License, or (at your
12 # option) any later version.
16 # * the GNU General Public License as published by the Free Software
17 # Foundation; either version 2 of the License, or (at your option) any
20 # or both in parallel, as here.
22 # The GNU MP Library is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 # You should have received copies of the GNU General Public License and the
28 # GNU Lesser General Public License along with the GNU MP Library. If not,
29 # see https://www.gnu.org/licenses/.
36 @ISA = qw(GMP Exporter);
39 %EXPORT_TAGS = ('all' => [qw(canonicalize den inv mpq num)],
40 'constants' => [@EXPORT],
41 'noconstants' => [@EXPORT] );
42 Exporter::export_ok_tags('all');
45 '+' => \&overload_add, '+=' => \&overload_addeq,
46 '-' => \&overload_sub, '-=' => \&overload_subeq,
47 '*' => \&overload_mul, '*=' => \&overload_muleq,
48 '/' => \&overload_div, '/=' => \&overload_diveq,
49 '**' => \&overload_pow, '**=' => \&overload_poweq,
50 '<<' => \&overload_lshift, '<<=' => \&overload_lshifteq,
51 '>>' => \&overload_rshift, '>>=' => \&overload_rshifteq,
53 'bool' => \&overload_bool,
54 'not' => \&overload_not,
55 '!' => \&overload_not,
56 '==' => \&overload_eq,
57 '!=' => \&overload_ne,
58 '<=>' => \&overload_spaceship,
59 '++' => \&overload_inc,
60 '--' => \&overload_dec,
61 'abs' => \&overload_abs,
62 'neg' => \&overload_neg,
63 '=' => \&overload_copy,
64 '""' => \&overload_string;
70 if ($_ eq ':constants') {
71 overload::constant ('integer' => \&overload_constant,
72 'binary' => \&overload_constant,
73 'float' => \&overload_constant);
74 } elsif ($_ eq ':noconstants') {
75 overload::remove_constant ('integer' => \&overload_constant,
76 'binary' => \&overload_constant,
77 'float' => \&overload_constant);
80 goto &Exporter::import;
88 # perl-indent-level: 2