Boost logo

Boost :

From: Andras Erdei (aerdei_at_[hidden])
Date: 2006-09-12 11:54:46

On 9/11/06, Jason Hise <0xchaos_at_[hidden]> wrote:
> I am
> trying to create a rational number class that does not break under
> overflow conditions, but just loses precision instead. While an
> overflow is detected I want to divide both numerator and denominator
> by 2 and keep trying. Also, I plan to support support infinity,
> negative infinity, and NaN (1/0, -1/0, and 0/0), so overflows which
> are really overflows for the rational type will result in these
> values.

you can download something pretty raw but already doing what you plan to do


check the comments at the beginning of bench1-op.cpp ... bench4-det.cpp
to find out how does it compare to double (and boost::rational)

there's a m$ project file included, on linux you can compile with
g++ -Wall -I<boost-path> -O3 -DFXS bench1-op.cpp


Boost list run by bdawes at, gregod at, cpdaniel at, john at