Float Double Parameters

kenny at uiucdcsb.CS.UIUC.EDU kenny at uiucdcsb.CS.UIUC.EDU
Sat Apr 12 01:38:00 AEST 1986


/* Written 10:34 pm  Apr  7, 1986 by herndon at umn-cs in uiucdcsb:net.lang.c */
  As far as I know (admittedly, not far) there is no longer any
good reason for the current schizophrenia about single/double
precision arithmetic, other than historical precedent.  Does
anyone know any other good reasons, such as design faults in
the VAX FPA?

				Robert Herndon
/* End of text from uiucdcsb:net.lang.c */

No, but you have (possibly) the wrong historical precedent.  On the GE 635
(and its successors), *all* floating-point arithmetic was double-precision
internally.  Single-precision *instructions* existed, but all they did was
to pad or truncate the operand appropriately.  The GE Fortran library's
mathematical functions all, therefore, accepted only double-precision
operands (SIN and DSIN were the same function).  When BCPL was built for the
635, it borrowed the existing Fortran library and hence had to adopt the
convention that all float's are promoted to double's for parameter passing.
'B' (Anyone else remember 'B'?  It was a neat language [compared to what was
available before 'C']) and later 'C' inherited this kludge from BCPL.

Kevin Kenny
University of Illinois at Urbana-Champaign
UUCP: {ihnp4,pur-ee,convex}!uiucdcs!kenny 
CSNET:	kenny at UIUC.CSNET
ARPA:	kenny at B.CS.UIUC.EDU	(kenny at UIUC.ARPA)

"Yes, understanding today's complex world is a bit like having bees live in
your head, but there they are."



More information about the Comp.lang.c mailing list