A rather obscure FP question. <9303091207.aa21340aVGR.BRL.MIL>

uunet!netcom.com!segfault!rfg uunet!netcom.com!segfault!rfg
Tue Mar 9 10:10:45 PST 1993


In response to my question about `sizeof(d1*d2)' Doug Gwyn writes:

  I don't understand why it is even an issue...

I didn't say it was an "issue".  The only "issue" was that I was ignorant
of the rules.

  The operand of sizeof is
  not "evaluated" as in executed, but merely inspected by the compiler
  to determine the operand's type.  License for run-time evaluation to
  higher precision of representation has nothing at all to do with the
  type system.  double*double is an expression resulting in type double,
  and sizeof that is however many bytes are allocated (including possible
  padding) by the implementation for storage of an object of type double.
  Typically that's something like 8.

Right.  I've got it straight now.  Thanks.

I *would* just like to interject that (for one implementation at least) it
might have been slightly more convenient for the implementor(s) if the
rules of the language had permitted `sizeof(d1*d2)' to yield the size
of the "type" or FP "format" in which the results of such a multiplication
(if executed) would be represented.
  
  It's possible that I contributed to the confusion some time back when I
  argued against "sizeof(1/0)"...

No.  You didn't.  My recent question was entirely unrelated to your earlier
posting on that different topic.


// Ronald F. Guilmette
//    domain address:	rfgasegfault.uucp
//    uucp address:	...!uunet!netcom.com!segfault!rfg



More information about the Numeric-interest mailing list