The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Hazy::Cosmic::Jive - stringify floating point numbers

SYNOPSIS

    use Hazy::Cosmic::Jive float_to_string;
    my $string = float_to_string (0.1);

VERSION

This document describes Hazy::Cosmic::Jive version 0.02 corresponding to git commit 769de3b79334706126eeb913508d0ae17656f609.

DESCRIPTION

This is an experimental module related to "stringification" (converting an NV into a PV) of floating point numbers.

This module is a helper for the "JSON::Create" serializer, intended to test out floating point serialization without inconveniencing users of that module with a multiplicity of testing versions.

FUNCTIONS

float_to_string

    my $string = float_to_string (0.1);

Convert an internal representation of a floating point number into a string representation, bypassing Perl's system in favour of our own method.

If the argument is not a floating point number, this prints a warning "Not a number" and returns the undefined value.

DIAGNOSTICS

Not a number

The input is not a number.

Error %d printing number %g

An unexpected condition occurred printing a number.

HISTORY

0.01
  • Test whether the methodology for splitting 64 bit floating point numbers is valid for a variety of CPAN testers' machines.

  • Test whether sprintf results are consistent over CPAN testers' machines.

0.02
  • Test handling of 10.0

  • Test with uint64_t rather than bit flags

SEE ALSO

CPAN modules

JSON::Create
Data::Float

Other references

http://babbage.cs.qc.cuny.edu/IEEE-754.old/Decimal.html

Convert decimal to floating point binary representation.

AUTHOR

Ben Bullock, <bkb@cpan.org>

COPYRIGHT & LICENCE

This package and associated files are copyright (C) 2016 Ben Bullock.

You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.