
I read a paper in college about floating-slash arithmetic, and possible hardware. Thought it a viable alternative to floating-point. (Paper in storage now, or I would give reference, especially since it is from ~1978.) My 2 cents - I would love to see a floating-slash representation. Best wishes, Kon On Mar 26, 2005, at 2:06 AM, Andras Erdei wrote:
Jonathan Turkanis wrote:
template < class unlimited > class unlimited <snip> fxs (and boost::rational when not used with bigints) represent numbers in a way similar to fixed point
+----+ +-------------------+ +--------------------+ fixed point |sign| |fixed integer field| |fixed fraction field| +----+ +-------------------+ +--------------------+
+----+ +---------------------+ +-----------------------+ fxs/rational |sign| |fixed numerator field| |fixed denominator field| +----+ +---------------------+ +-----------------------+
another option is to use a "floating slash" representation like floating point numbers
+----+ +--------------------+ +--------------------+ floating point |sign| |fixed mantissa field| |fixed exponent field| +----+ +--------------------+ +--------------------+ ^ | | | +----------------------+
+----+ +-------------------+ +-----------------+ floating slash |sign| |fixed num/den field| |fixed slash field| +----+ +-------------------+ +-----------------+ ^ | | | +----------------------+
this would allow representing very big numbers (when the slash position is right to the num/den field the denominator is 1) and very small numbers (when the slash poition is left to the num/den field the numerator is 1)
br, andras _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost