Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!munnari.oz.au!bruce!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: how to write hash function for double Message-ID: <6471@goanna.cs.rmit.oz.au> Date: 24 Jun 91 08:22:57 GMT Article-I.D.: goanna.6471 References: <67790003@hpcupt1.cup.hp.com> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 15 In article <67790003@hpcupt1.cup.hp.com>, thomasw@hpcupt1.cup.hp.com (Thomas Wang) writes: > The question is whether there can be two different bit patterns of double > that represented the same double number? It depends on which machine you are using. On a machine with IEEE arithmetic, do you want to consider -0.0 and +0.0 "the same"? (== must, but they behave differently.) On an IBM mainframe, there are a great many bit patterns corresponding to the name number. On a VAX (except for there being two different kinds of "double") you are ok. Converting to text is not a good idea; it is relatively expensive and it isn't always as accurate as it should be. -- I agree with Jim Giles about many of the deficiencies of present UNIX.