Xref: utzoo comp.lang.c:11748 comp.std.c:248 sci.math:4359 Path: utzoo!attcan!uunet!husc6!rutgers!rochester!pt.cs.cmu.edu!speech2.cs.cmu.edu!jgk From: jgk@speech2.cs.cmu.edu (Joe Keane) Newsgroups: comp.lang.c,comp.std.c,sci.math Subject: Re: Floating point puzzle Keywords: floating point representation Message-ID: <2627@pt.cs.cmu.edu> Date: 7 Aug 88 22:59:26 GMT References: <3117@emory.uucp> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 12 In article <3117@emory.uucp> riddle@emory.uucp (Larry Riddle) writes: >However, my experiments seem to imply that floats have an 11 >bit biased exponent (offset by 1023) and only a 20 bit normalized >mantissa, exactly the same as doubles, except double has a 52 bit >mantissa. (This belongs on comp.lang.c!) The problem is, a float parameter gets converted to double. So you're looking at the first 32 bits of the double representation. To look at the float representation, use this: printf("x: %lx", * (long *) &x); --Joe