Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.541.076 Times

Test::Number::Delta 1.03

  Date Added: March 16, 2010  |  Visits: 771


Report Broken Link
Printer Friendly Version

Product Homepage
Download (73 downloads)

Test::Number::Delta is a Perl module to compare the difference between numbers against a given tolerance. SYNOPSIS # Import test functions use Test::Number::Delta; # Equality test with default tolerance delta_ok( 1e-5, 2e-5, values within 1e-6); # Inequality test with default tolerance delta_not_ok( 1e-5, 2e-5, values not within 1e-6); # Provide specific tolerance delta_within( 1e-3, 2e-3, 1e-4, values within 1e-4); delta_not_within( 1e-3, 2e-3, 1e-4, values not within 1e-4); # Compare arrays or matrices @a = ( 3.14, 1.41 ); @b = ( 3.15, 1.41 ); delta_ok( @a, @b, compare @a and @b ); # Set a different default tolerance use Test::Number::Delta within => 1e-5; delta_ok( 1.1e-5, 2e-5, values within 1e-5); # ok # Set a relative tolerance use Test::Number::Delta relative => 1e-3; delta_ok( 1.01, 1.0099, values within 1.01e-3); At some point or another, most programmers find they need to compare floating-point numbers for equality. The typical idiom is to test if the absolute value of the difference of the numbers is within a desired tolerance, usually called epsilon. This module provides such a function for use with Test::Harness. Usage is similar to other test functions described in Test::More. Semantically, the delta_within function replaces this kind of construct: ok ( abs($p - $q) < $epsilon, $p is equal to $q ) or diag "$p is not equal to $q to within $epsilon"; While theres nothing wrong with that construct, its painful to type it repeatedly in a test script. This module does the same thing with a single function call. The delta_ok function is similar, but either uses a global default value for epsilon or else calculates a relative epsilon on the fly so that epsilon is scaled automatically to the size of the arguments to delta_ok. Both functions are exported automatically. Because checking floating-point equality is not always reliable, it is not possible to check the equal to boundary of less than or equal to epsilon. Therefore, Test::Number::Delta only compares if the absolute value of the difference is less than epsilon (for equality tests) or greater than epsilon (for inequality tests)..

Requirements: No special requirements
Platforms: Linux
Keyword: Compare Delta Epsilon Equal To Libraries Numbers Perl Module Programming Test Testnumberdelta Tolerance
Users rating: 0/10

License: Freeware Size: 18.43 KB
More Reviews or Write Review

Libraries  -  Test::Differences 0.47
Test::Differences Perl module contains test strings and data structures and show differences if not ok. SYNOPSIS use Test; ## Or use Test::More use Test::Differences; eq_or_diff $got, "anbncn", "testing strings"; eq_or_diff @got, [qw( a b...
8.19 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Time::Skew 0.1
Time::Skew is a Perl module that computes local clock skew with respect to a remote clock. SYNOPISI use Time::Skew # Init Convex Hull and timing data my $hull=[]; my $result={}; # Iterate data point introduction...
45.06 KB  
Libraries  -  Encode 2.21
Encode is a Perl module created to deal with character encodings. SYNOPSIS use Encode; Table of Contents Encode consists of a collection of modules whose details are too big to fit in one document. This POD itself explains the top-level...
1.9 MB  
Libraries  -  Math::BaseCalc 1.011
Math::BaseCalc is a Perl module that can convert numbers between various bases. SYNOPSIS use Math::BaseCalc; my $calc = new Math::BaseCalc(digits => [0,1]); #Binary my $bin_string = $calc->to_base(465); # Convert 465 to binary...
4.1 KB  
Libraries  -  Inline-API 0.44
Inline-API is a Perl module that teach you how to bind a programming language to Perl using SYNOPSIS #!/usr/bin/perl use Inline Foo; say_it(foo); # Use Foo to print "Hello, Foo" __Foo__ foo-sub say_it { foo-my $foo =...
91.14 KB  
Libraries  -  MIME::Words 5.420
MIME::Words is a Perl module to deal with RFC-1522 encoded words. SYNOPSIS Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait....
389.12 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  Mail::Addressbook::Convert::Ldif 1.1
Mail::Addressbook::Convert::Ldif is a Perl module that can convert to and from Ldif formatted addressbooks. SYNOPSIS use strict; use Mail::Addressbook::Convert::Ldif; my $LDIF = new Mail::Addressbook::Convert::Ldif(); my $LdifInFile...
30.72 KB  
Libraries  -  Mail::Addressbook::Convert::Tsv 1.1
Mail::Addressbook::Convert::Tsv is a Perl module that can convert to and from Tsv ( Tab Separated )formatted addressbooks. SYNOPSIS use strict; use Mail::Addressbook::Convert::Tsv; my $TSV = new Mail::Addressbook::Convert::Tsv(); my...
30.72 KB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB