18 Oct 2003 15:28:03 -0400

Related articles |
---|

rational to floating point? thant@acm.org (Thant Tessman) (2003-10-13) |

Re: rational to floating point? mitr@volny.cz (Miloslav Trmac) (2003-10-13) |

Re: rational to floating point? nmm1@cus.cam.ac.uk (2003-10-13) |

Re: rational to floating point? haberg@matematik.su.se (2003-10-13) |

Re: rational to floating point? thant@acm.org (Thant Tessman) (2003-10-14) |

Re: rational to floating point? fjh@cs.mu.oz.au (Fergus Henderson) (2003-10-18) |

Re: rational to floating point? nmm1@cus.cam.ac.uk (2003-10-18) |

Re: rational to floating point? Peter-Lawrence.Montgomery@cwi.nl (2003-10-18) |

Re: rational to floating point? thant@acm.org (Thant Tessman) (2003-10-27) |

From: | nmm1@cus.cam.ac.uk (Nick Maclaren) |

Newsgroups: | comp.compilers |

Date: | 18 Oct 2003 15:28:03 -0400 |

Organization: | University of Cambridge, England |

References: | 03-10-065 03-10-080 |

Keywords: | arithmetic |

Posted-Date: | 18 Oct 2003 15:28:03 EDT |

Thant Tessman <thant@acm.org> writes:

|>

|> I haven't had time to give the above the full attention they deserve,

|> but I think I have a handle on how to produce the significand and

|> exponent of the floating point number (as arbitrary-precision integers

|> (conveniently in base 256 in my implementation)). What's missing is

|> the conversion to the actual float. The Clinger paper makes use of a

|> mysteriously unexplained "make-float" function, for which there seems

|> to be no portable manifestation. Things like radix conversion are no

|> sweat, but bit twiddling is not something I've had a lot of experience

|> with. Is it typical in these situations to produce the IEEE 754 float

|> bit pattern directly? If so, do I have to worry not only about whether

|> that's the standard on the chosen platform, but also about things like

|> endianness?

|>

|> [Yes, one typically twiddles the bits directly, and you have to be aware

|> of endianness. Fortunately, these days the only popular formats are

|> big- and little-endian IEEE and maybe legacy IBM hex. -John]

You have forgotten Intel 80-bit format :-)

And remember that there are several variants of IEEE - e.g. whether

denormals are supported. But they are all subsets, except for

extended precision.

Regards,

Nick Maclaren.

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.