📄 index.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN"><!-- This collection of hypertext pages is Copyright 1995-2005 by Steve Summit. --><!-- Content from the book "C Programming FAQs: Frequently Asked Questions" --><!-- (Addison-Wesley, 1995, ISBN 0-201-84519-9) is made available here by --><!-- permission of the author and the publisher as a service to the community. --><!-- It is intended to complement the use of the published text --><!-- and is protected by international copyright laws. --><!-- The on-line content may be accessed freely for personal use --><!-- but may not be published or retransmitted without explicit permission. --><!-- --><!-- this page built Sat Dec 24 21:47:46 2005 by faqproc version 2.7 --><!-- from source file fp.sgml dated Fri Jul 2 23:51:18 2004 --><!-- corresponding to FAQ list version 4.0 --><html><!-- Mirrored from c-faq.com/fp/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:56:10 GMT --><head><meta name=GENERATOR content="faqproc"><title>Floating Point</title></head><body bgcolor="#ffffff"> <a href="../index-2.html"><img src="../images/buttontop.gif" alt="top/contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><hr><H1>14. Floating Point</H1><p><a href="printfprec.html" rel=subdocument>14.1</a>When I set a <TT>float</TT> variable to, say, 3.1,why is <TT>printf</TT> printing it as 3.0999999?</p><p><a href="fpdecl.html" rel=subdocument>14.2</a>I'm trying to take somesquare roots,and I've simplified the code down to<pre> main() { printf("%f\n", sqrt(144.)); }</pre>but I'mstillgettingcrazy numbers.</p><p><a href="libm.html" rel=subdocument>14.3</a>I'm trying to do some simpletrig,and I am #including <TT><math.h></TT>,butthe linker keepscomplainingthat functions like <TT>sin</TT>and <TT>cos</TT>are undefined.</p><p><a href="strangefp.html" rel=subdocument>14.4a</a>My floating-point calculations are acting strangely and giving medifferent answers on different machines.</p><p><a href="degrees.html" rel=subdocument>14.4b</a>I'm sure I've got thetrig functionsdeclared correctly,but they're still giving me wrong answers.</p><p><a href="fpequal.html" rel=subdocument>14.5</a>What's a good way to check for ``close enough''floating-point equality?</p><p><a href="round.html" rel=subdocument>14.6</a>How do I round numbers?</p><p><a href="pow.html" rel=subdocument>14.7</a>Why doesn't C have anexponentiation operator?</p><p><a href="mpi.html" rel=subdocument>14.8</a>The predefined constant <TT>M_PI</TT>seems to be missing frommy machine's copy of<TT><math.h></TT>.</p><p><a href="nan.html" rel=subdocument>14.9</a>How do Iset variables to, ortest forIEEE NaN(``Not a Number'')and other special values?</p><p><a href="fpexcepts.html" rel=subdocument>14.10</a>How can Ihandlefloating-point exceptions gracefully?</p><p><a href="complex.html" rel=subdocument>14.11</a>What's a good way to implement complex numbers in C?</p><p><a href="mathsrc.html" rel=subdocument>14.12</a>I'm looking for somecode to do:</p><p>Fast Fourier Transforms (FFT's)<br>matrix arithmetic (multiplication, inversion, etc.)<br>complex arithmetic<br></p><p><a href="fpnotlinked.html" rel=subdocument>14.13</a>I'm having trouble with a Turbo C program which crashes and sayssomething like``floating point formats not linked.''</p><hr><p><a href="../index-2.html">top</a></p><p><a href="../questions.html"><img src="../images/buttontop.gif" alt="contents"></a><a href="../search.html"><img src="../images/buttonsrch.gif" alt="search"></a><br><a href="../about.html">about this FAQ list</a> <a href="../eskimo.html">about eskimo</a> <a href="../search.html">search</a> <a href="../feedback.html">feedback</a> <a href="copyright.html">copyright</a><p>Hosted by<a href="http://www.eskimo.com/"><img src="../../www.eskimo.com/img/link/eskitiny.gif" alt="Eskimo North"></a></p></body><!-- Mirrored from c-faq.com/fp/index.html by HTTrack Website Copier/3.x [XR&CO'2008], Sat, 14 Mar 2009 07:56:15 GMT --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -