
6 Sep
2005
6 Sep
'05
3:55 p.m.
"Joel Eidsath" <jeidsath@gmail.com> wrote in message news:431C91C1.3030502@gmail.com...
I think that I need to define the mathematical concept of rational numbers here. A rational number is any number that _can_ be written as a / b. But a rational class does not have to be stored as a separate numerator and denominator. In an arbitrary precision library, you definitely do not want to implement rational numbers as a struct with a numerator and denominator.
Examples of basic rational number types in C++: float, double, etc.
On the contrary, conversion from rational to float is an example of a "lossy conversion". regards Andy Little