Math::Fortran - Perl implimentations of Fortrans sign and log10


Math-Fortran documentation Contained in the Math-Fortran distribution.

Index


Code Index:

NAME

Top

    Math::Fortran - Perl implimentations of Fortrans sign and log10

SYNOPSIS

Top

    use Math::Fortran qw(log10 sign);
    $v=log10($x);
    $v=sign($y);
    $v=sign($x,$y);

DESCRIPTION

Top

This module provides and exports some mathematical functions which are built in in Fortran but not in Perl. Currently there are only 2 included.

HISTORY

Top

$Log: Fortran.pm,v $ Revision 1.1 1995/12/26 09:43:01 willijar Initial revision

BUGS

Top

I welcome other entries for this module and bug reports.

AUTHOR

Top

John A.R. Williams <J.A.R.Williams@aston.ac.uk>


Math-Fortran documentation Contained in the Math-Fortran distribution.

# $Id: Fortran.pm,v 1.1 1995/12/26 09:43:01 willijar Exp $
require Exporter;
package Math::Fortran;
@ISA=qw(Exporter);
@EXPORT_OK=qw(sign log10);
use strict;

sub log10 { log($_[0])/log(10); }

sub sign {
    my ($a1,$a2)=@_;
    if (defined $a2) {
	return $a2>=0 ? abs($a1):-abs($a1);
    }
    return $a1>=0 ? +1 : -1;
}

1;