automatic version update by autodist [release 1.06-1mamba;Sun May 16 2021]
This commit is contained in:
parent
5a0cef5e82
commit
ee84887eb6
@ -1,11 +1,8 @@
|
|||||||
# perl-Test-Number-Delta
|
# perl-Test-Number-Delta
|
||||||
|
|
||||||
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:
|
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
|
ok ( abs($p - $q) < $epsilon, '$p is equal to $q' ) or
|
||||||
diag "$p is not equal to $q to within $epsilon";
|
diag "$p is not equal to $q to within $epsilon";
|
||||||
|
|
||||||
While there's nothing wrong with that construct, it's 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.
|
While there's nothing wrong with that construct, it's 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).
|
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).
|
||||||
|
|
||||||
|
@ -1,67 +1,62 @@
|
|||||||
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
|
%define perl_major_ver %(eval `perl -V:version`; echo ${version%*.[0-9]*}.0)
|
||||||
|
|
||||||
Name: perl-Test-Number-Delta
|
Name: perl-Test-Number-Delta
|
||||||
Version: 1.03
|
Version: 1.06
|
||||||
Release: 3mamba
|
Release: 1mamba
|
||||||
Summary: Test::Number::Delta - Compare the difference between numbers against a given tolerance
|
Summary: Test::Number::Delta - Compare the difference between numbers against a given tolerance
|
||||||
Group: System/Libraries/Perl
|
Group: System/Libraries/Perl
|
||||||
Vendor: openmamba
|
Vendor: openmamba
|
||||||
Distribution: openmamba
|
Distribution: openmamba
|
||||||
Packager: Automatic Build System <autodist@mambasoft.it>
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
URL: http://www.cpan.org
|
URL: https://www.cpan.org/
|
||||||
Source: http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/Test-Number-Delta-%{version}.tar.gz
|
Source: https://cpan.metacpan.org/modules/by-module/Test/Test-Number-Delta-%{version}.tar.gz
|
||||||
License: GPL, Artistic
|
License: GPL, Artistic
|
||||||
Requires: perl >= %perl_major_ver
|
## AUTOBUILDREQ-BEGIN
|
||||||
|
BuildRequires: perl-devel
|
||||||
|
## AUTOBUILDREQ-END
|
||||||
BuildRequires: perl-devel >= %perl_major_ver
|
BuildRequires: perl-devel >= %perl_major_ver
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
Requires: perl >= %perl_major_ver
|
||||||
|
|
||||||
%description
|
%description
|
||||||
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:
|
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
|
ok ( abs($p - $q) < $epsilon, '$p is equal to $q' ) or
|
||||||
diag "$p is not equal to $q to within $epsilon";
|
diag "$p is not equal to $q to within $epsilon";
|
||||||
|
|
||||||
While there's nothing wrong with that construct, it's 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.
|
While there's nothing wrong with that construct, it's 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).
|
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).
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
|
||||||
%setup -q -n Test-Number-Delta-%{version}
|
%setup -q -n Test-Number-Delta-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
perl Build.PL installdirs=vendor
|
%{__perl} Makefile.PL PREFIX=%{_prefix} INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
|
||||||
./Build
|
|
||||||
./Build test
|
%make
|
||||||
|
%make test
|
||||||
|
|
||||||
%install
|
%install
|
||||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
./Build install \
|
%makeinstall_perl
|
||||||
destdir="%{buildroot}" \
|
|
||||||
--install_path bindoc="%{_mandir}/man1" \
|
|
||||||
--install_path libdoc="%{_mandir}/man3"
|
|
||||||
|
|
||||||
packlist=`find %{buildroot} -name .packlist`
|
packlist=`find %{buildroot} -name .packlist`
|
||||||
[ -z "$packlist" ] && exit 1 || cat $packlist | \
|
[ -z "$packlist" ] && exit 1 || cat $packlist | \
|
||||||
sed "s,%buildroot,,g;s,.*/man/.*,&.gz,g" | \
|
sed "s,%{buildroot},,g;s,.*/man/.*,&.gz,g" | \
|
||||||
sort -u > .packlist && rm $packlist
|
sort -u > .packlist && rm -f $packlist
|
||||||
|
|
||||||
find %{buildroot}%{perl_vendorlib} \
|
|
||||||
-type d -depth -exec rmdir {} 2>/dev/null \;
|
|
||||||
|
|
||||||
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
|
strid=`echo $packlist | sed 's,.*auto\(.*\)/.packlist,\1,'`
|
||||||
for dir in `find %{buildroot} -type d | grep $strid`; do
|
for dir in `find %{buildroot} -type d | grep $strid`; do
|
||||||
echo %dir ${dir#%buildroot} >> .packlist
|
echo "%dir ${dir#%buildroot}" >> .packlist
|
||||||
done
|
done
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||||||
rm -f .packlist
|
|
||||||
|
|
||||||
%files -f .packlist
|
%files -f .packlist
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sun May 16 2021 Automatic Build System <autodist@mambasoft.it> 1.06-1mamba
|
||||||
|
- automatic version update by autodist
|
||||||
|
|
||||||
* Thu Aug 29 2013 Automatic Build System <autodist@mambasoft.it> 1.03-3mamba
|
* Thu Aug 29 2013 Automatic Build System <autodist@mambasoft.it> 1.03-3mamba
|
||||||
- automatic rebuild by autodist
|
- automatic rebuild by autodist
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user