Decimal Integer Type

Joel C. Salomon joelcsalomon at gmail.com
Fri Jan 25 11:43:03 PST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lawrence Dol wrote:
> Has any consideration ever been given to support a native type for decimal numbers, like Java's BigDecimal, and IBM's packed decimal type without the accuracy limitations of typical floating point representations.  This would be such that the value 1.3 would be exactly and precisely 1.3 and not actually 1.29999999999999999999 (recurring to precision limit).

... As in the decimal floating-point formats in the revised IEEE 754?

> Because the type knows how many decimal places are represented, doing a=1.10 and b=1.1234, yields for c=a+b a result of c==1.2234.

The 754r decimal formats have support for recording the precision of a
number.

Actually David Hough posted this to the numeric-interest mailing list a
few days ago:
> Another draft, 1.6.0, of the IEEE 754R spec has been prepared for
> review.
> Persons who wish to comment may obtain a review copy from Bob Davis,
> bob at scsi.com
> Comments are due to Bob before Feb 2.
> Review comments from end-user technical application programmers is
> especially needed, since they are the nominal target audience.
> Hardware implementers are already well represented.
>
> My overview, ballot, and specific comments are at
> http://754r.ucbtest.org/msc-ballots/ballot5.html
> I revise my comments from time to time as I study the draft and
> reflect on comments by other reviewers.

Comments by language implementors is probably also apropos.

- --Joel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHmjvGzLx4GzBL9dYRAjY4AKC1jQU+vpLQWOUjBKlyslZm5rdxTACfRk49
DAio4rgLhMnBjxBeesi0yZM=
=ltJk
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list