[comp.lang.c] long double

henry@utzoo.uucp (Henry Spencer) (04/27/89)

In article <12661@lanl.gov> jlg@lanl.gov (Jim Giles) writes:
>By the way, what _is_ "long double"?  I've never seen a C compiler which
>has such a thing.  The proposed ANSI standard mentions "long double",
>but doesn't require it to be more precise than double! ...

The proposed standard also doesn't require float to be less precise than
double.  The reason is the same:  the exact set of easily-supported sizes
is machine-specific.  Providing float lets the user get at a smaller type,
IF there is one.  Providing long double lets the user get at a larger
type, IF there is one.  Some machines have all three.  Many don't.
-- 
Mars in 1980s:  USSR, 2 tries, |     Henry Spencer at U of Toronto Zoology
2 failures; USA, 0 tries.      | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

ggw@wolves.UUCP (Gregory G. Woodbury) (05/01/89)

In <1989Apr26.171042.4029@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) wrote:
> In article <12661@lanl.gov> jlg@lanl.gov (Jim Giles) writes:
> >By the way, what _is_ "long double"?  I've never seen a C compiler which
> >has such a thing.  The proposed ANSI standard mentions "long double",
> >but doesn't require it to be more precise than double! ...
> 
> The proposed standard also doesn't require float to be less precise than
> double.  The reason is the same:  the exact set of easily-supported sizes
> is machine-specific.  Providing float lets the user get at a smaller type,
> IF there is one.  Providing long double lets the user get at a larger
> type, IF there is one.  Some machines have all three.  Many don't.

For wierdness: Think C (LightSpeed C) has these floating point types:
	float		4 bytes
	double		10 bytes
	short double	8 bytes

The manual notes that the short double is provided because the 8 byte values
are the slowest to compute with in the SANE 68881 environment (macintosh).