7 use Scalar
::Util qw
/looks_like_number/;
10 our @ISA = qw(Exporter DynaLoader);
12 our @EXPORT_OK = qw( is_similar );
13 use constant MAX_DOUBLE
=> 1.7976931348623157e+308;
14 use constant MIN_DOUBLE
=> 2.2250738585072014e-308;
15 use constant MAX_FLOAT
=> 3.40282347e+38;
16 use constant MIN_FLOAT
=> 1.175494351e-38;
21 Math::GSL - Perl interface to the GNU Scientific Library (GSL) using SWIG
32 use Math::GSL::Sf qw/ ... /;
41 Jonathan Leto, C<< <jonathan at leto.net> >>
45 Please report any bugs or feature requests to C<bug-math-gsl at rt.cpan.org>, or through
46 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Math::GSL>. I will be notified, and then you'll
47 automatically be notified of progress on your bug as I make changes.
52 You can find documentation for this module with the perldoc command.
56 or online at L<http://leto.net/code/Math-GSL/>
59 You can also look for information at:
63 =item * RT: CPAN's request tracker
65 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Math::GSL>
67 =item * AnnoCPAN: Annotated CPAN documentation
69 L<http://annocpan.org/dist/Math::GSL>
73 L<http://cpanratings.perl.org/d/Math::GSL>
77 L<http://search.cpan.org/dist/Math::GSL>
82 =head1 ACKNOWLEDGEMENTS
85 =head1 COPYRIGHT & LICENSE
87 Copyright 2008 Jonathan Leto, all rights reserved.
89 This program is free software; you can redistribute it and/or modify it
90 under the same terms as Perl itself.
96 my ($self,$args) = @_;
97 my $class = ref $self || $self || 'Math::GSL';
105 CDF Errno Fit Machine
106 Poly PowInt Randist SF Types
112 my ($self,$results,$class, $eps) = @_;
114 while (my($k,$v)=each %$results){
117 $x = eval qq{${class}::$k};
122 print "got $x for $k\n" if defined $ENV{DEBUG
};
123 if(defined $x && $x =~ /nan|inf/i){
124 ok
( $v eq $x, "'$v'?='$x'" );
126 my $res = abs($x-$v);
128 : ok
( $res < $eps, "$k ?= $x, +- $res" );
134 my ($x,$y, $eps) = @_;
136 abs($x-$y) < $eps ?
1 : 0;
142 return 0 unless ( defined $x && looks_like_number
($x) );
144 return 1 if ($x == 0);
155 return 0 unless ( defined $x && looks_like_number
($x) );
157 return 1 if ($x == 0);
166 sub _has_quads
{ $Config{use64bitint
} eq 'define' || ($Config{longsize
} >= 8) }
167 sub _has_long_doubles
{ $Config{d_longdbl
} eq 'define' }
168 sub _has_long_doubles_as_default
{ $Config{uselongdouble
} eq 'define' }
169 sub _has_long_doubles_same_as_doubles
{ $Config{doublesize
} == $Config{longdblsize
} }
171 sub _assert_dies
($;$)
173 my ($code,$msg) = @_;
174 my $status = eval { &$code };
175 print "status=||$status||\n\$\?=$?\n\$\!=$!\n" if 0;
176 $@ ? ok
(1, $msg) : ok
(0, join "\n", $@
, $msg );