Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:languages:perl:CPAN-M
perl-Math-Ryu
perl-Math-Ryu.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-Math-Ryu.spec of Package perl-Math-Ryu
# # spec file for package perl-Math-Ryu # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name Math-Ryu Name: perl-Math-Ryu Version: 1.04 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Perl interface to Ryu (sane NV-to-string conversion) URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/S/SI/SISYPHUS/%{cpan_name}-%{version}.tar.gz BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Test::More) >= 0.88 Requires: perl(Test::More) >= 0.88 %{perl_requires} %description Using functionality provided by the Ryu library, we convert an NV to a decimal string, such that no information is lost, yet keeping the string as short as possible. Stringification of NVs provided by perl's print() fuction does not always adhere to this principle - that is, the condition ( "$nv" == $nv ) is not always true. For example: $nv = 1.4 / 10; # "$nv" != $nv We can address this by using (s)printf. For example, on a perl whose $Config{nvtype} is 'double', we could do sprintf("%.17g", $nv) to provide the stringification. Then we will find that, except for NaN, the condition ( sprintf("%.17g", $nv) == $nv ) is always true. But this presents another problem in that "%.17g" formatting will sometimes provide more significant decimal digits than are needed. For example: printf("%.17g", 0.1); # prints '0.10000000000000001', even though # the condition ("0.1" == 0.1) is also true. This module provides the nv2s() function which returns a decimal string representation of its (NV) argumennt. Unless $nv is NaN: 1) the condition ( nv2s($nv) == $nv ) is always true; and 2) the string returned by nv2s($nv) will contain the fewest number of siginificant decimal digits needed for that first condition to hold. The aim is that the formatting of the string returned by nv2s() will be the same as provided by python3's print() function. (Please report any variances - especially substantive ones.) %prep %autosetup -n %{cpan_name}-%{version} find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644 %build perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}" %make_build %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %doc Apache_License.txt Changes README %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor