1 <!DOCTYPE HTML PUBLIC
"-//W3O//DTD W3 HTML 2.0//EN">
2 <!-- This collection of hypertext pages is Copyright 1995-7 by Steve Summit. -->
3 <!-- This material may be freely redistributed and used -->
4 <!-- but may not be republished or sold without permission. -->
7 <link rev=
"owner" href=
"mailto:scs@eskimo.com">
8 <link rev=
"made" href=
"mailto:scs@eskimo.com">
9 <title>18.1.4:
<TT>long double
</TT></title>
10 <link href=
"sx4ca.html" rev=precedes
>
11 <link href=
"sx4ea.html" rel=precedes
>
12 <link href=
"sx4a.html" rev=subdocument
>
15 <H3>18.1.4:
<TT>long double
</TT></H3>
17 <p>The two common floating-point types in C are
<TT>float
</TT> and
<TT>double
</TT>.
18 We haven't said much about the differences between them, because
19 there isn't much to say:
20 <TT>double
</TT> generally gives you more precision
21 (more digits' worth of significance),
22 and perhaps more range
23 (an ability to use numbers with larger
26 Continuing this progression,
27 ANSI C added a third floating-point type,
33 If you're using a machine with an extended-precision floating-point format,
34 <TT>long double
</TT> will let you access that format.
35 But if your machine has only two floating-point formats,
36 <TT>float
</TT> and
<TT>double
</TT> will probably map to those,
37 and
<TT>long double
</TT> won't end up being
38 any better than plain
<TT>double
</TT>.
39 </p><p>The
<TT>printf
</TT> and
<TT>scanf
</TT> formats
40 for
<TT>long double
</TT>
41 are
<TT>%Le
</TT>,
<TT>%Lf
</TT>, and
<TT>%Lg
</TT>.
45 <a href=
"sx4ca.html" rev=precedes
>prev
</a>
46 <a href=
"sx4ea.html" rel=precedes
>next
</a>
47 <a href=
"sx4a.html" rev=subdocument
>up
</a>
48 <a href=
"top.html">top
</a>
51 This page by
<a href=
"http://www.eskimo.com/~scs/">Steve Summit
</a>
52 //
<a href=
"copyright.html">Copyright
</a> 1996-
1999
53 //
<a href=
"mailto:scs@eskimo.com">mail feedback
</a>