Hi Doug,

go to http://www.rebol.org/math/index.html and pick up a copy of Eric Long's
decimal.r. He writes:
Purpose: Contains functions for the manipulation of decimal values, packaged
into the REAL object. These provide full support for native binary
floating-point file IO, compatible with C,
       FORTRAN, etc. REBOL decimal and money values may also be saved and
loaded with no roundoff error. This package is necessary because the standard
REBOL representation of
       decimal values may round off one or two significant digits, and the
rounding of money values is an even greater source of error. This script
contains two more objects, IEEE and
       EMPIRICAL, which provide several functions useful for exploring how
decimal values are represented as double floating point numbers, and for
testing the inexactness of the REBOL
       comparison functions.

Direct download link:
http://www.rebol.org/math/decimal.r

This may be exactly what your friend is looking for.

Elan

[EMAIL PROTECTED] wrote:

> A colleague forwarded this set of comments/questions to me
> and I am forwarding to the REBOL list...
>
> > When performing mathematical calculations,
> > I've come across some interesting results, particularly with the modular
> > division ( // ) operation.
> >
> > For example, if I perform
> > >> e: 1.22 // 0.01
> > in REBOL, e will equal 9.99999999999992E-3.
> > Although the answer is 0.01, or 1E-2, I can type
> > >> e = 0.01 and true
> >
> > will be returned.
> >
> > While accepting 9.99999999999992E-3 is sufficient in most cases,
> > I may be in trouble if I wanted to convert the value of e to a string, for
> > example.
> > Is there anyway to make this calculation return display 1E-2 exactly?
> >
> > I am using REBOL/Core Version 2.3.0.3.1.
> >
> > Thanx,
> > -C. Hampton

Reply via email to