Playing with the bits of floats

Raymond Juimong Chen rjchen at phoenix.Princeton.EDU
Thu Jan 19 06:06:14 AEST 1989


[as is my wont, I put quoted material at the END.]

Harumph.  To emphasize that the code is inherently non-portable, why
not just code the test in question in assembly language?  This would
certainly point out to anyone trying to (heaven forbid!) port the code
that something amiss is up.  (I mean, the code is so blatantly non-portable,
one wonders how one could possibly code it in a language which was designed
with portability in mind.)

There seems to be this great movement to make C the One True Programming
Language That Lets You Do Anything You Want.  I don't think it is.
If you want to get ``under the hood'' and play dirty tricks, then
use assembly language.

And for those of you who missed last week's episode...

Max Rible wants to treat a float as an int-like bit pattern.  ``I'm 
interested in speed, not portability.''

Herman Rubin agrees that ``every language should make it easy for the 
knowledgeable programmer to do these things.''

Doug Gwyn disagress, maintaining that ``Generating efficient code for 
routine floating-point operations of the job of the compiler, not 
the high-level programmer.''

Herman Rubin concedes that ``the particular situation may be highly non-
portable.  Note that Max has stated that he wants speed, and not necessarily 
portability.''
-- 
Raymond Chen	UUCP: ...allegra!princeton!{phoenix|pucc}!rjchen
		BITNET: rjchen at phoenix.UUCP, rjchen at pucc
		ARPA: rjchen at phoenix.PRINCETON.EDU, rjchen at pucc.PRINCETON.EDU
"Say something, please!  ('Yes' would be best.)" - The Doctor



More information about the Comp.lang.c mailing list