1*36ac495dSmrg<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2*36ac495dSmrg<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 12. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="std_contents.html" title="Part II. Standard Contents" /><link rel="prev" href="algorithms.html" title="Chapter 11. Algorithms" /><link rel="next" href="generalized_numeric_operations.html" title="Generalized Operations" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 12. 3*36ac495dSmrg Numerics 4*36ac495dSmrg 5*36ac495dSmrg</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part II. 6*36ac495dSmrg Standard Contents 7*36ac495dSmrg </th><td width="20%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"></a>Chapter 12. 8*36ac495dSmrg Numerics 9*36ac495dSmrg <a id="id-1.3.4.10.1.1.1" class="indexterm"></a> 10*36ac495dSmrg</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.complex"></a>Complex</h2></div></div></div><p> 11*36ac495dSmrg </p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.complex.processing"></a>complex Processing</h3></div></div></div><p> 12*36ac495dSmrg </p><p>Using <code class="code">complex<></code> becomes even more comple- er, sorry, 13*36ac495dSmrg <span class="emphasis"><em>complicated</em></span>, with the not-quite-gratuitously-incompatible 14*36ac495dSmrg addition of complex types to the C language. David Tribble has 15*36ac495dSmrg compiled a list of C++98 and C99 conflict points; his description of 16*36ac495dSmrg C's new type versus those of C++ and how to get them playing together 17*36ac495dSmrg nicely is 18*36ac495dSmrg<a class="link" href="http://david.tribble.com/text/cdiffs.htm#C99-complex" target="_top">here</a>. 19*36ac495dSmrg </p><p><code class="code">complex<></code> is intended to be instantiated with a 20*36ac495dSmrg floating-point type. As long as you meet that and some other basic 21*36ac495dSmrg requirements, then the resulting instantiation has all of the usual 22*36ac495dSmrg math operators defined, as well as definitions of <code class="code">op<<</code> 23*36ac495dSmrg and <code class="code">op>></code> that work with iostreams: <code class="code">op<<</code> 24*36ac495dSmrg prints <code class="code">(u,v)</code> and <code class="code">op>></code> can read <code class="code">u</code>, 25*36ac495dSmrg <code class="code">(u)</code>, and <code class="code">(u,v)</code>. 26*36ac495dSmrg </p><p>As an extension to C++11 and for increased compatibility with C, 27*36ac495dSmrg <code class="code"><complex.h></code> includes both <code class="code"><complex></code> 28*36ac495dSmrg and the C99 <code class="code"><complex.h></code> (if the C library provides 29*36ac495dSmrg it). 30*36ac495dSmrg </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="std_contents.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 11. 31*36ac495dSmrg Algorithms 32*36ac495dSmrg 33*36ac495dSmrg </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Generalized Operations</td></tr></table></div></body></html>