NAME

OP::Double - Overloaded double-precision number object

DESCRIPTION

Double-precision floating point number, only not really.

This class just avoids E notation when stringifying, and uses DOUBLE(30,10) for its database column type. Otherwise, it is overloaded to work like a native number in numeric and string operations, which means it does not handle high-precision or bignum math operations, such as those supported by Math::BigFloat, without floating point lossiness.

Extends OP::Float.

SYNOPSIS

use OP::Double;

my $double = OP::Double->new(.0000001);

print "$double\n";

print "$double * 2 = ". ( $double*2 ) ."\n";

DIAGNOSTICS

OP::Double is overloaded to just work like a native number.

It does so by treating the most and least significant values as string-like, or integer-like, depending on the situation. In short, it's a big hack. Precision is not guaranteed.

Should the unlikely event arise that you need to know what the backing reference value looks like-- it's an ARRAY ref. Position 0 contains the most significant value (left side of decimal), and position 1 contains a zero-padded string of the least significant value (right side of decimal).

SEE ALSO

This file is part of OP.