Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Number::WithError 0.08

    Download button

    No screenshots available
    Downloads: 374  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Steffen Mueller | More programs
    Perl Artistic License / FREE
    July 6th, 2007, 02:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Number::WithError description

    A Perl module that contains numbers with error propagation and scientific rounding.

    Number::WithError is a Perl module that contains numbers with error propagation and scientific rounding.

    SYNOPSIS

    use Number::WithError;

    my $num = Number::WithError->new(5.647, 0.31);
    print $num . "n";
    # prints '5.65e+00 +/- 3.1e-01'
    # (I.e. it automatically does scientific rounding)

    my $another = $num * 3;
    print $another . "n";
    # propagates the error assuming gaussian errors
    # prints '1.69e+01 +/- 9.3e-01'

    # trigonometric functions also work:
    print sin($another) . "n";
    # prints '-9.4e-01 +/- 3.1e-01'

    my $third = $another ** $num;
    print $third. "n";
    # propagates both errors into one.
    # prints '8.7e+06 +/- 8.1e+06'

    # shortcut for the constructor:
    use Number::WithError 'witherror';
    $num = witherror('0.00032678', ['2.5e-5', '3e-5'], 5e-6);
    # can deal with any number of errors, even with asymmetric errors
    print $num . "n";
    # prints '3.268e-04 + 2.5e-05 - 3.00e-05 +/- 5.0e-06'
    # Note: It may be annyoing that they don't all have the same
    # exponent, but they *do* all have the sam significant digit!


    This class is a container class for numbers with a number of associated symmetric and asymmetric errors. It overloads practically all common arithmetic operations and trigonometric functions to propagate the errors. It can do proper scientific rounding (as explained in more detail below in the documentation of the significant_digit() method).

    You can use Math::BigFloat objects as the internal representation of numbers in order to support arbitrary precision calculations.

    Errors are propagated using Gaussian error propagation.

    With a notable exception, the test suite covers way over ninety percent of the code. The remaining holes are mostly difficult-to-test corner cases and sanity tests. The comparison routines are the exception for which there will be more extensive tests in a future release.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    error propagation | scientific rounding | Perl module | Number | error | propagation

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM