Skip to content

Commit fa1a8f3

Browse files
authored
Merge pull request #11 from pryrt/v0.017_002_namingconvention
v0.017_002 merge: I've solidified on naming convention (#6), at least for now. Bring it back into the trunk and then tag an alpha release
2 parents bda83c6 + 43922c4 commit fa1a8f3

17 files changed

+637
-233
lines changed

CHANGES

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
11
Revision history for Perl module Data::IEEE754::Tools.
22

33
v0.017 internal development version
4-
- v0.017_001: META = adding Travis-CI, coveralls.io, automatic signatures, etc.
4+
- v0.017_001_github_integrations: META = adding Travis-CI, coveralls.io,
5+
automatic signatures, etc.
6+
- v0.017_002_namingconvention: start changing names per the naming-
7+
convention issue#6
8+
- make
9+
:floatingpoint, to_hex_floatingpoint(), to_dec_floatingpoint()
10+
aliases to
11+
:convertToString, convertToHexString(),
12+
convertToDecimalString()
13+
- make
14+
:raw754, hexstr754_from_double(), binstr754_from_double(),
15+
hexstr754_to_double(), binstr754_to_double()
16+
aliases to
17+
:internalString, convertToInternalHexString(),
18+
convertToInternalBinaryString(), convertFromInternalHexString(),
19+
convertFromInternalBinaryString()
20+
- figured out a framework for issue#7's multiple bitness, but disable
21+
for now
22+
- improve error messages, and stop module compile on mixed-endianness
23+
- add test coverage for aliases
24+
- add author test coverage for import-tags
25+
- change VERSION from a version.pm object to a plain old string '0.017_002',
26+
which allows the Makefile.PL to properly extract the {provides}{version}
27+
for META files
528

629
v0.016 2016-Aug-29
730
- had a bug in v0.014 Makefile which caused CPAN to not
831
index; tried a couple of submissions, none of which
932
really did what I wanted. Will try to move up to next
1033
public release version number (v0.016), and ask PAUSE
11-
to forget the incorrect v0.14001.0 release, and hopefully
34+
to forget the incorrect v0.14003.0 release, and hopefully
1235
re-index to this release.
1336

1437
v0.014 2016-Aug-29

MANIFEST

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Makefile.PL
44
MANIFEST This list of files
55
lib/Data/IEEE754/Tools.pm
66
README
7+
RELEASE.md
78
t/00-load.t
8-
t/01-raw754.t
9-
t/02-floatingpoint.t
9+
t/01-internalstring.t
10+
t/02-converttostr.t
1011
t/03-ulp.t
1112
t/04-nextupdown.t
1213
t/05-nextafter.t
@@ -15,5 +16,7 @@ t/07-info.t
1516
t/08-totalorder.t
1617
t/09-signbit.t
1718
t/10-copysign.t
19+
t/11-aliases.t
1820
xt/00-sign.t
21+
xt/11-tags.t
1922
TODO

MANIFEST.SKIP

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
pod.css
1111
^.svn/
1212
^MYMETA
13-
.travis.yml$
14-
^RELEASE.md$
13+
.travis.yml$

Makefile.PL

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use 5.006;
1313
'warnings' => 0,
1414
'strict' => 0,
1515
'Carp' => 0,
16+
'Config' => 0,
1617
},
1718
);
1819

@@ -42,10 +43,16 @@ use 5.006;
4243
},
4344
# automatically determine the versions for 'provides'; MM->parse_version exists as of MM v6.31, so not a problem with >= 6.46
4445
# => this comes out right when printed... but MYMETA.* shows values that look wrong
46+
#my $vstr = MM->parse_version( $mm_args{VERSION_FROM} );
47+
#print STDERR $vstr, $/;
48+
#my $qstr = "'$vstr'";
49+
#print STDERR $qstr, $/;
50+
#(my $novstr = $qstr) =~ s/v//;
51+
#print STDERR $novstr, $/;
4552
$mm_args{META_MERGE}{provides} = {
4653
$mm_args{NAME} => {
4754
file => $mm_args{VERSION_FROM},
48-
version => ''.MM->parse_version( $mm_args{VERSION_FROM} ),
55+
version => MM->parse_version( $mm_args{VERSION_FROM} ),
4956
}
5057
};
5158
}
@@ -88,7 +95,7 @@ sub MY::postamble {
8895
TEST_D = $(ABSPERLRUN) -MExtUtils::Command -e test_d --
8996
9097
# run a test coverage report
91-
testcover :: lib/Math/PRBS.pm
98+
testcover ::
9299
$(NOECHO) cover -test -report html
93100
94101
# run author-tests on the original

README

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,61 @@
11
NAME
2-
3-
Data::IEEE754::Tools - Various tools for understanding and manipulating the underlying IEEE-754 representation of floating point values
2+
Data::IEEE754::Tools - Various tools for understanding and manipulating
3+
the underlying IEEE-754 representation of floating point values
44

55
DESCRIPTION
6-
7-
These tools give access to the underlying IEEE 754 floating-point 64bit
8-
representation used by many instances of Perl (see perlguts). They
9-
include functions for converting from the 64bit internal representation
10-
to a string that shows those bits (either as hexadecimal or binary) and
11-
back, functions for converting that encoded value into a more
12-
human-readable format to give insight into the meaning of the encoded
13-
values, and functions to manipulate the smallest possible change for a
14-
given floating-point value (which is the ULP
15-
<https://en.wikipedia.org/wiki/Unit_in_the_last_place> or "Unit in the
16-
Last Place").
17-
18-
COMPATIBILITY
19-
20-
Data::IEEE754::Tools works with 64bit floating-point representations.
21-
22-
If you have a Perl setup which uses a larger representation (for
23-
example, "use Config; print $Config{nvsize}; # 16 => 128bit"), values
24-
reported by this module will be reduced in precision to fit the 64bit
25-
representation.
26-
27-
If you have a Perl setup which uses a smaller representation (for
28-
example, "use Config; print $Config{nvsize}; # 4 => 32bit"), the
29-
installation will likely fail, because the unit tests were not set up
30-
for lower precision inputs. However, forcing the installation *might*
31-
still allow coercion from the smaller Perl NV into a true IEEE 754
32-
double (64bit) floating-point, but there is no guarantee it will work.
6+
These tools give access to the underlying IEEE 754 floating-point 64bit
7+
representation used by many instances of Perl (see perlguts). They
8+
include functions for converting from the 64bit internal representation
9+
to a string that shows those bits (either as hexadecimal or binary) and
10+
back, functions for converting that encoded value into a more
11+
human-readable format to give insight into the meaning of the encoded
12+
values, and functions to manipulate the smallest possible change for a
13+
given floating-point value (which is the ULP
14+
<https://en.wikipedia.org/wiki/Unit_in_the_last_place> or "Unit in the
15+
Last Place").
16+
17+
Compatibility
18+
Data::IEEE754::Tools works with 64bit floating-point representations.
19+
20+
If you have a Perl setup which uses a larger representation (for
21+
example, "use Config; print $Config{nvsize}; # 16 => 128bit"), values
22+
reported by this module will be reduced in precision to fit the 64bit
23+
representation.
24+
25+
If you have a Perl setup which uses a smaller representation (for
26+
example, "use Config; print $Config{nvsize}; # 4 => 32bit"), the
27+
installation will likely fail, because the unit tests were not set up
28+
for lower precision inputs. However, forcing the installation *might*
29+
still allow coercion from the smaller Perl NV into a true IEEE 754
30+
double (64bit) floating-point, but there is no guarantee it will work.
3331

3432
INSTALLATION
33+
To install this module, use your favorite CPAN client.
3534

36-
To install this module, use your favorite CPAN client.
37-
38-
For a manual install, type the following:
35+
For a manual install, type the following:
3936

40-
perl Makefile.PL
41-
make
42-
make test
43-
make install
37+
perl Makefile.PL
38+
make
39+
make test
40+
make install
4441

45-
(On Windows machines, you may need to use "dmake" instead of "make".)
42+
(On Windows machines, you may need to use "dmake" instead of "make".)
4643

4744
AUTHOR
45+
Peter C. Jones "<petercj AT cpan DOT org>"
4846

49-
Peter C. Jones <petercj AT cpan DOT org>
50-
51-
Please report any bugs or feature requests emailing <bug-Data-IEEE754-Tools AT rt.cpan.org>
52-
or thru the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-IEEE754-Tools>
47+
Please report any bugs or feature requests emailing
48+
"<bug-Data-IEEE754-Tools AT rt.cpan.org>" or thru the web interface at
49+
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-IEEE754-Tools>, or
50+
thru the repository's interface at
51+
<https://github.com/pryrt/Data-IEEE754-Tools/issues>.
5352

5453
COPYRIGHT
54+
Copyright (C) 2016 Peter C. Jones
5555

56-
Copyright (C) 2016 Peter C. Jones
57-
58-
LICENCE
59-
60-
This program is free software; you can redistribute it and/or modify it
61-
under the terms of either: the GNU General Public License as published
62-
by the Free Software Foundation; or the Artistic License.
56+
LICENSE
57+
This program is free software; you can redistribute it and/or modify it
58+
under the terms of either: the GNU General Public License as published
59+
by the Free Software Foundation; or the Artistic License.
6360

64-
See <http://dev.perl.org/licenses/> for more information.
61+
See <http://dev.perl.org/licenses/> for more information.

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ I use a local svn client to checkout the GitHub repo. All these things can be d
2828
* **Verify Documentation:**
2929
* make sure versioning is correct
3030
* verify POD and README
31+
* `pod2text lib/Data/IEEE754/Tools.pm README`, then edit so that only
32+
NAME, DESCRIPTION, COMPATIBILITY, INSTALLATION, AUTHOR, COPYRIGHT, LICENSE
33+
remain
3134
* verify HISTORY
3235

3336
* **Build Distribution**

TODO

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@ TODO
33
+ IEEE754 5.4.2 => 5.12
44
<format>-convertFormat
55
<format>-convertFromDecimalCharacter
6-
<format>-convertToDecimalCharacter
6+
# converts a string decimal number (ie, output of to_dec_floatingpoint)
7+
# into a <format>-floating point value
8+
<format>-convertToDecimalCharacter(source, conversionSpecification)
79
# alias for to_dec_floatingpoint()
810
# conversionSpecification is supposed to indicate formatting
911
# might want to use an optional integer which indicates how many places
10-
# after the fractional-point to display (default to 16 => %16.16s for to_dec_floatingpoint)
12+
# after the fractional-point to display (default to 16 => %.16f for to_dec_floatingpoint)
1113
+ IEEE754 5.4.3 => 5.12
1214
<format>-convertFromHexCharacter
15+
# converts a string hexadecimal number (ie, output of to_hex_floatingpoint)
16+
# into a <format>-floating point value
1317
<format>-convertToHexCharacter(source, conversionSpecification)
1418
# alias for to_hex_floatingpoint()
1519
# I originally thought these were aliases for my rawhex754 functions... but no
1620
# conversionSpecification is supposed to indicate formatting
1721
# might want to use an optional integer which indicates how many places
18-
# after the fractional-point to display (default to 16 => %16.16s for to_dec_floatingpoint)
22+
# after the fractional-point to display (default to 13 => %13.13s for to_hex_floatingpoint)
23+
+ valid <format> = qw(binary32 binary64 binary128)
1924

2025
- long-term: add in _32bit and _128bit versions
2126
- what's official name of 128bit long-double? quad? something else? check IEEE754

0 commit comments

Comments
 (0)