summaryrefslogtreecommitdiff
path: root/libstdc++-v3/doc/html/manual/numerics_and_c.html
blob: 3a2fb499e50d5f30a164de0cab0d5b75301feabd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Interacting with C</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"/><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      library&#10;    "/><link rel="home" href="../spine.html" title="The GNU C++ Library"/><link rel="up" href="numerics.html" title="Chapter 12.  Numerics"/><link rel="prev" href="generalized_numeric_operations.html" title="Generalized Operations"/><link rel="next" href="io.html" title="Chapter 13.  Input and Output"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Interacting with C</th></tr><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Chapter 12. 
  Numerics
  
</th><td align="right"> <a accesskey="n" href="io.html">Next</a></td></tr></table><hr/></div><div class="section" title="Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics.c"/>Interacting with C</h2></div></div></div><div class="section" title="Numerics vs. Arrays"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.c.array"/>Numerics vs. Arrays</h3></div></div></div><p>One of the major reasons why FORTRAN can chew through numbers so well
      is that it is defined to be free of pointer aliasing, an assumption
      that C89 is not allowed to make, and neither is C++98.  C99 adds a new
      keyword, <code class="code">restrict</code>, to apply to individual pointers.  The
      C++ solution is contained in the library rather than the language
      (although many vendors can be expected to add this to their compilers
      as an extension).
   </p><p>That library solution is a set of two classes, five template classes,
      and "a whole bunch" of functions.  The classes are required
      to be free of pointer aliasing, so compilers can optimize the
      daylights out of them the same way that they have been for FORTRAN.
      They are collectively called <code class="code">valarray</code>, although strictly
      speaking this is only one of the five template classes, and they are
      designed to be familiar to people who have worked with the BLAS
      libraries before.
   </p></div><div class="section" title="C99"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.c.c99"/>C99</h3></div></div></div><p>In addition to the other topics on this page, we'll note here some
      of the C99 features that appear in libstdc++.
   </p><p>The C99 features depend on the <code class="code">--enable-c99</code> configure flag.
      This flag is already on by default, but it can be disabled by the
      user.  Also, the configuration machinery will disable it if the
      necessary support for C99 (e.g., header files) cannot be found.
   </p><p>As of GCC 3.0, C99 support includes classification functions
      such as <code class="code">isnormal</code>, <code class="code">isgreater</code>,
      <code class="code">isnan</code>, etc.
      The functions used for 'long long' support such as <code class="code">strtoll</code>
      are supported, as is the <code class="code">lldiv_t</code> typedef.  Also supported
      are the wide character functions using 'long long', like
      <code class="code">wcstoll</code>.
   </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><td align="center"><a accesskey="u" href="numerics.html">Up</a></td><td align="right"> <a accesskey="n" href="io.html">Next</a></td></tr><tr><td align="left" valign="top">Generalized Operations </td><td align="center"><a accesskey="h" href="../spine.html">Home</a></td><td align="right" valign="top"> Chapter 13. 
  Input and Output
  
</td></tr></table></div></body></html>