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

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

Serving Software Downloads in 956 Categories, Downloaded 49.480.088 Times

Test::Number::Delta 1.03

  Date Added: March 16, 2010  |  Visits: 1.237

Test::Number::Delta

Report Broken Link
Printer Friendly Version


Product Homepage
Download (91 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
USER REVIEWS
More Reviews or Write Review


TEST::NUMBER::DELTA RELATED
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  -  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  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
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  -  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  
Programming  -  Perl Module Manager 1.2.0.18
Perl Module Manager helps you to install, un-install and manage Perl modules from a CPAN site and other sources in an easy and intuitive way. Allows you to search through thousands of useful modules and libraries on a CPAN site and its mirrors....
1.44 MB  
Libraries  -  Inline-API 0.44
Inline-API is a Perl module that teach you how to bind a programming language to Perl using Inline.pm. 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  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
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