* remove "\r" nonsense
[mascara-docs.git] / C / the.ansi.c.programming.language / c.programming.notes.int / sx4da.html
blobc4a0188e3e0c5d7c990c2b234282ebbfb376649e
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. -->
5 <html>
6 <head>
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>
13 </head>
14 <body>
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
24 exponents)
25 than <TT>float</TT>.
26 Continuing this progression,
27 ANSI C added a third floating-point type,
28 <TT>long double</TT>,
29 which may give you
30 even more range
32 even more precision.
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>.
42 </p><hr>
43 <p>
44 Read sequentially:
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>
49 </p>
50 <p>
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>
54 </p>
55 </body>
56 </html>