~pythonregexp2.7/python/issue2636-01+09-01-01

« back to all changes in this revision

Viewing changes to Doc/library/math.rst

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 00:02:12 UTC
  • mfrom: (39022.1.34 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922000212-7r0q4f4ugiq57jph
Merged in changes from the Atomic Grouping / Possessive Qualifiers branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
   Return the absolute value of *x*.
44
44
 
 
45
 
45
46
.. function:: factorial(x)
46
47
 
47
 
   Return *x* factorial.  Raises :exc:`ValueError` if *x* is not intergral or
 
48
   Return *x* factorial.  Raises :exc:`ValueError` if *x* is not integral or
48
49
   is negative.
49
50
 
 
51
   .. versionadded:: 2.6
 
52
 
 
53
 
50
54
.. function:: floor(x)
51
55
 
52
56
   Return the floor of *x* as a float, the largest integer value less than or equal
79
83
   apart" the internal representation of a float in a portable way.
80
84
 
81
85
 
 
86
.. function:: fsum(iterable)
 
87
 
 
88
   Return an accurate floating point sum of values in the iterable.  Avoids
 
89
   loss of precision by tracking multiple intermediate partial sums.  The
 
90
   algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the
 
91
   typical case where the rounding mode is half-even.
 
92
 
 
93
   .. note::
 
94
 
 
95
      The accuracy of fsum() may be impaired on builds that use
 
96
      extended precision addition and then double-round the results.
 
97
 
 
98
   .. versionadded:: 2.6
 
99
 
 
100
 
82
101
.. function:: isinf(x)
83
102
 
84
103
   Checks if the float *x* is positive or negative infinite.
107
126
   Return the fractional and integer parts of *x*.  Both results carry the sign of
108
127
   *x*, and both are floats.
109
128
 
110
 
.. function:: sum(iterable)
111
 
 
112
 
   Return an accurate floating point sum of values in the iterable.  Avoids
113
 
   loss of precision by tracking multiple intermediate partial sums.  The
114
 
   algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the
115
 
   typical case where the rounding mode is half-even.
116
129
 
117
130
.. function:: trunc(x)
118
131
 
121
134
 
122
135
   .. versionadded:: 2.6
123
136
 
 
137
 
124
138
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
125
139
than their C equivalents: they take a single argument and return a pair of
126
140
values, rather than returning their second return value through an 'output
134
148
 
135
149
Power and logarithmic functions:
136
150
 
137
 
 
138
151
.. function:: exp(x)
139
152
 
140
153
   Return ``e**x``.
179
192
 
180
193
   Return the square root of *x*.
181
194
 
 
195
 
182
196
Trigonometric functions:
183
197
 
184
 
 
185
198
.. function:: acos(x)
186
199
 
187
200
   Return the arc cosine of *x*, in radians.
227
240
 
228
241
   Return the tangent of *x* radians.
229
242
 
 
243
 
230
244
Angular conversion:
231
245
 
232
 
 
233
246
.. function:: degrees(x)
234
247
 
235
248
   Converts angle *x* from radians to degrees.
239
252
 
240
253
   Converts angle *x* from degrees to radians.
241
254
 
 
255
 
242
256
Hyperbolic functions:
243
257
 
244
 
 
245
258
.. function:: acosh(x)
246
259
 
247
260
   Return the inverse hyperbolic cosine of *x*.
278
291
   Return the hyperbolic tangent of *x*.
279
292
 
280
293
 
281
 
 
282
294
The module also defines two mathematical constants:
283
295
 
284
 
 
285
296
.. data:: pi
286
297
 
287
298
   The mathematical constant *pi*.
306
317
   :exc:`OverflowError`, ``math.log(0L)`` may raise :exc:`ValueError` instead.
307
318
 
308
319
   All functions return a quiet *NaN* if at least one of the args is *NaN*.
309
 
   Signaling *NaN*s raise an exception. The exception type still depends on the
 
320
   Signaling *NaN*\s raise an exception. The exception type still depends on the
310
321
   platform and libm implementation. It's usually :exc:`ValueError` for *EDOM*
311
322
   and :exc:`OverflowError` for errno *ERANGE*.
312
323