Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10406)

Side by Side Diff: Modules/_decimal/docstrings.h

Issue 7652: Merge C version of decimal into py3k.
Patch Set: Created 7 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Modules/_decimal/_decimal.c ('k') | Modules/_decimal/ISSUES.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2001-2010 Python Software Foundation. All Rights Reserved.
3 * Modified and extended by Stefan Krah.
4 */
5
6
7 #ifndef DOCSTRINGS_H
8 #define DOCSTRINGS_H
9
10
11 #include "pymacro.h"
12
13
14 /******************************************************************************/
15 /* Module */
16 /******************************************************************************/
17
18
19 PyDoc_STRVAR(doc__decimal,
20 "C decimal arithmetic module");
21
22 PyDoc_STRVAR(doc_getcontext,"\n\
23 getcontext() - Get the current default context.\n\
24 \n");
25
26 PyDoc_STRVAR(doc_setcontext,"\n\
27 setcontext(c) - Set a new default context.\n\
28 \n");
29
30 PyDoc_STRVAR(doc_localcontext,"\n\
31 localcontext(c) - Return a context manager that will set the default context\n\
32 to a copy of c on entry to the with-statement and restore the previous default\n \
33 context when exiting the with-statement. If no context is specified, a copy of\n \
34 the current default context is used.\n\
35 \n");
36
37 #ifdef EXTRA_FUNCTIONALITY
38 PyDoc_STRVAR(doc_ieee_context,"\n\
39 IEEEContext(bits) - Return a context object initialized to the proper values for \n\
40 one of the IEEE interchange formats. The argument must be a multiple of 32 and\n \
41 less than IEEE_CONTEXT_MAX_BITS. For the most common values, the constants\n\
42 DECIMAL32, DECIMAL64 and DECIMAL128 are provided.\n\
43 \n");
44 #endif
45
46
47 /******************************************************************************/
48 /* Decimal Object and Methods */
49 /******************************************************************************/
50
51 PyDoc_STRVAR(doc_decimal,"\n\
52 Decimal([value[, context]]): Construct a new Decimal object from value.\n\
53 \n\
54 value can be an integer, string, tuple, or another Decimal object.\n\
55 If no value is given, return Decimal('0'). The context does not affect\n\
56 the conversion and is only passed to determine if the InvalidOperation\n\
57 trap is active.\n\
58 \n");
59
60 PyDoc_STRVAR(doc_adjusted,"\n\
61 adjusted() - Return the adjusted exponent of the number.\n\
62 \n\
63 Defined as exp + digits - 1.\n\
64 \n");
65
66 PyDoc_STRVAR(doc_as_tuple,"\n\
67 as_tuple() - Return a tuple representation of the number.\n\
68 \n");
69
70 PyDoc_STRVAR(doc_canonical,"\n\
71 canonical() - Return the canonical encoding of the argument. Currently,\n\
72 the encoding of a Decimal instance is always canonical, so this operation\n\
73 returns its argument unchanged.\n\
74 \n");
75
76 PyDoc_STRVAR(doc_compare,"\n\
77 compare(other[, context]) - Compare self to other. Return a decimal value:\n\
78 \n\
79 a or b is a NaN ==> Decimal('NaN')\n\
80 a < b ==> Decimal('-1')\n\
81 a == b ==> Decimal('0')\n\
82 a > b ==> Decimal('1')\n\
83 \n");
84
85 PyDoc_STRVAR(doc_compare_signal,"\n\
86 compare_signal(other[, context]) - Identical to compare, except that\n\
87 all NaNs signal.\n\
88 \n");
89
90 PyDoc_STRVAR(doc_compare_total,"\n\
91 compare_total(other) - Compare two operands using their abstract representation\ n\
92 rather than their numerical value. Similar to the compare() method, but the\n\
93 result gives a total ordering on Decimal instances. Two Decimal instances with\n \
94 the same numeric value but different representations compare unequal in this\n\
95 ordering:\n\
96 \n\
97 >>> Decimal('12.0').compare_total(Decimal('12'))\n\
98 Decimal('-1')\n\
99 \n\
100 Quiet and signaling NaNs are also included in the total ordering. The result\n\
101 of this function is Decimal('0') if both operands have the same representation,\ n\
102 Decimal('-1') if the first operand is lower in the total order than the second,\ n\
103 and Decimal('1') if the first operand is higher in the total order than the\n\
104 second operand. See the specification for details of the total order.\n\
105 \n");
106
107 PyDoc_STRVAR(doc_compare_total_mag,"\n\
108 compare_total_mag(other) - Compare two operands using their abstract\n\
109 representation rather than their value as in compare_total(), but\n\
110 ignoring the sign of each operand. x.compare_total_mag(y) is\n\
111 equivalent to x.copy_abs().compare_total(y.copy_abs()).\n\
112 \n");
113
114 PyDoc_STRVAR(doc_conjugate,"\n\
115 conjugate() - Return self.\n\
116 \n");
117
118 PyDoc_STRVAR(doc_copy_abs,"\n\
119 copy_abs() - Return the absolute value of the argument. This operation\n\
120 is unaffected by the context and is quiet: no flags are changed and no\n\
121 rounding is performed.\n\
122 \n");
123
124 PyDoc_STRVAR(doc_copy_negate,"\n\
125 copy_negate() - Return the negation of the argument. This operation is\n\
126 unaffected by the context and is quiet: no flags are changed and no\n\
127 rounding is performed.\n\
128 \n");
129
130 PyDoc_STRVAR(doc_copy_sign,"\n\
131 copy_sign(other) - Return a copy of the first operand with the sign set\n\
132 to be the same as the sign of the second operand. For example:\n\
133 \n\
134 >>> Decimal('2.3').copy_sign(Decimal('-1.5'))\n\
135 Decimal('-2.3')\n\
136 \n\
137 This operation is unaffected by the context and is quiet: no flags are\n\
138 changed and no rounding is performed.\n\
139 \n");
140
141 PyDoc_STRVAR(doc_exp,"\n\
142 exp([context]) - Return the value of the (natural) exponential function e**x\n\
143 at the given number. The ROUND_HALF_EVEN rounding mode is used. If the _allcr\n\
144 field of the context is set to 1 (default), the result is correctly rounded.\n\
145 \n");
146
147 PyDoc_STRVAR(doc_from_float,"\n\
148 from_float(f) - Class method that converts a float to a decimal number, exactly. \n\
149 Since 0.1 is not exactly representable in binary floating point,\n\
150 Decimal.from_float(0.1) is not the same as Decimal('0.1').\n\
151 \n\
152 >>> Decimal.from_float(0.1)\n\
153 Decimal('0.1000000000000000055511151231257827021181583404541015625')\n\
154 >>> Decimal.from_float(float('nan'))\n\
155 Decimal('NaN')\n\
156 >>> Decimal.from_float(float('inf'))\n\
157 Decimal('Infinity')\n\
158 >>> Decimal.from_float(float('-inf'))\n\
159 Decimal('-Infinity')\n\
160 \n\
161 \n");
162
163 PyDoc_STRVAR(doc_fma,"\n\
164 fma(other, third[, context]) - Fused multiply-add. Return self*other+third\n\
165 with no rounding of the intermediate product self*other.\n\
166 \n\
167 >>> Decimal(2).fma(3, 5)\n\
168 Decimal('11')\n\
169 \n\
170 \n");
171
172 PyDoc_STRVAR(doc_is_canonical,"\n\
173 is_canonical() - Return True if the argument is canonical and False otherwise.\n \
174 Currently, a Decimal instance is always canonical, so this operation always\n\
175 returns True.\n\
176 \n");
177
178 PyDoc_STRVAR(doc_is_finite,"\n\
179 is_finite() - Return True if the argument is a finite number, and False if the\n \
180 argument is infinite or a NaN.\n\
181 \n");
182
183 PyDoc_STRVAR(doc_is_infinite,"\n\
184 is_infinite() - Return True if the argument is either positive or negative\n\
185 infinity and False otherwise.\n\
186 \n");
187
188 PyDoc_STRVAR(doc_is_nan,"\n\
189 is_nan() - Return True if the argument is a (quiet or signaling) NaN and\n\
190 False otherwise.\n\
191 \n");
192
193 PyDoc_STRVAR(doc_is_normal,"\n\
194 is_normal([context]) - Return True if the argument is a normal finite non-zero\n \
195 number with an adjusted exponent greater than or equal to Emin. Return False\n\
196 if the argument is zero, subnormal, infinite or a NaN.\n\
197 \n");
198
199 PyDoc_STRVAR(doc_is_qnan,"\n\
200 is_qnan() - Return True if the argument is a quiet NaN, and False otherwise.\n\
201 \n");
202
203 PyDoc_STRVAR(doc_is_signed,"\n\
204 is_signed() - Return True if the argument has a negative sign and\n\
205 False otherwise. Note that both zeros and NaNs can carry signs.\n\
206 \n");
207
208 PyDoc_STRVAR(doc_is_snan,"\n\
209 is_snan() - Return True if the argument is a signaling NaN and False otherwise.\ n\
210 \n");
211
212 PyDoc_STRVAR(doc_is_subnormal,"\n\
213 is_subnormal([context]) - Return True if the argument is subnormal, and False\n\
214 otherwise. A number is subnormal if it is non-zero, finite, and has an\n\
215 adjusted exponent less than Emin.\n\
216 \n");
217
218 PyDoc_STRVAR(doc_is_zero,"\n\
219 is_zero() - Return True if the argument is a (positive or negative) zero and\n\
220 False otherwise.\n\
221 \n");
222
223 PyDoc_STRVAR(doc_ln,"\n\
224 ln([context]) - Return the natural (base e) logarithm of the operand.\n\
225 The ROUND_HALF_EVEN rounding mode is used. If the _allcr field of the\n\
226 context is set to 1, the result is correctly rounded.\n\
227 \n");
228
229 PyDoc_STRVAR(doc_log10,"\n\
230 log10([context]) - Return the base ten logarithm of the operand.\n\
231 The ROUND_HALF_EVEN rounding mode is used. If the _allcr field of the\n\
232 context is set to 1, the result is correctly rounded.\n\
233 \n");
234
235 PyDoc_STRVAR(doc_logb,"\n\
236 logb([context]) - For a non-zero number, return the adjusted exponent\n\
237 of the operand as a Decimal instance. If the operand is a zero, then\n\
238 Decimal('-Infinity') is returned and the DivisionByZero condition is\n\
239 raised. If the operand is an infinity then Decimal('Infinity') is returned.\n\
240 \n");
241
242 PyDoc_STRVAR(doc_logical_and,"\n\
243 logical_and(other[, context]) - Return the digit-wise and of the two\n\
244 (logical) operands.\n\
245 \n");
246
247 PyDoc_STRVAR(doc_logical_invert,"\n\
248 logical_invert([context]) - Return the digit-wise inversion of the\n\
249 (logical) operand.\n\
250 \n");
251
252 PyDoc_STRVAR(doc_logical_or,"\n\
253 logical_or(other[, context]) - Return the digit-wise or of the two\n\
254 (logical) operands.\n\
255 \n");
256
257 PyDoc_STRVAR(doc_logical_xor,"\n\
258 logical_xor(other[, context]) - Return the digit-wise exclusive or of the\n\
259 two (logical) operands.\n\
260 \n");
261
262 PyDoc_STRVAR(doc_max,"\n\
263 max(other[, context]) - Maximum of self and other. If one operand is a quiet\n\
264 NaN and the other is numeric, the numeric operand is returned.\n\
265 \n");
266
267 PyDoc_STRVAR(doc_max_mag,"\n\
268 max_mag(other[, context]) - Similar to the max() method, but the comparison is\n \
269 done using the absolute values of the operands.\n\
270 \n");
271
272 PyDoc_STRVAR(doc_min,"\n\
273 min(other[, context]) - Minimum of self and other. If one operand is a quiet\n\
274 NaN and the other is numeric, the numeric operand is returned.\n\
275 \n");
276
277 PyDoc_STRVAR(doc_min_mag,"\n\
278 min_mag(other[, context]) - Similar to the min() method, but the comparison is\n \
279 done using the absolute values of the operands.\n\
280 \n");
281
282 PyDoc_STRVAR(doc_next_minus,"\n\
283 next_minus([context]) - Return the largest number representable in the given\n\
284 context (or in the current default context if no context is given) that is\n\
285 smaller than the given operand.\n\
286 \n");
287
288 PyDoc_STRVAR(doc_next_plus,"\n\
289 next_plus([context]) - Return the smallest number representable in the given\n\
290 context (or in the current default context if no context is given) that is\n\
291 larger than the given operand.\n\
292 \n");
293
294 PyDoc_STRVAR(doc_next_toward,"\n\
295 next_toward(other[, context]) - If the two operands are unequal, return the\n\
296 number closest to the first operand in the direction of the second operand.\n\
297 If both operands are numerically equal, return a copy of the first operand\n\
298 with the sign set to be the same as the sign of the second operand.\n\
299 \n");
300
301 PyDoc_STRVAR(doc_normalize,"\n\
302 normalize([context]) - Normalize the number by stripping the rightmost trailing\ n\
303 zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\
304 for producing canonical values for members of an equivalence class. For example, \n\
305 Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent\n\
306 value Decimal('32.1').\n\
307 \n");
308
309 PyDoc_STRVAR(doc_number_class,"\n\
310 number_class([context]) - Return a string describing the class of the operand.\n \
311 The returned value is one of the following ten strings:\n\
312 \n\
313 * '-Infinity', indicating that the operand is negative infinity.\n\
314 * '-Normal', indicating that the operand is a negative normal number.\n\
315 * '-Subnormal', indicating that the operand is negative and subnormal.\n\
316 * '-Zero', indicating that the operand is a negative zero.\n\
317 * '+Zero', indicating that the operand is a positive zero.\n\
318 * '+Subnormal', indicating that the operand is positive and subnormal.\n\
319 * '+Normal', indicating that the operand is a positive normal number.\n\
320 * '+Infinity', indicating that the operand is positive infinity.\n\
321 * 'NaN', indicating that the operand is a quiet NaN (Not a Number).\n\
322 * 'sNaN', indicating that the operand is a signaling NaN.\n\
323 \n\
324 \n");
325
326 PyDoc_STRVAR(doc_quantize,"\n\
327 quantize(exp[, rounding[, context]]) - Return a value equal to the first\n\
328 operand after rounding and having the exponent of the second operand.\n\
329 \n\
330 >>> Decimal('1.41421356').quantize(Decimal('1.000'))\n\
331 Decimal('1.414')\n\
332 \n\
333 Unlike other operations, if the length of the coefficient after the quantize\n\
334 operation would be greater than precision, then an InvalidOperation is signaled. \n\
335 This guarantees that, unless there is an error condition, the quantized exponent \n\
336 is always equal to that of the right-hand operand.\n\
337 \n\
338 Also unlike other operations, quantize never signals Underflow, even if the\n\
339 result is subnormal and inexact.\n\
340 \n\
341 If the exponent of the second operand is larger than that of the first, then\n\
342 rounding may be necessary. In this case, the rounding mode is determined by the\ n\
343 rounding argument if given, else by the given context argument; if neither\n\
344 argument is given, the rounding mode of the current thread's context is used.\n\
345 \n");
346
347 PyDoc_STRVAR(doc_radix,"\n\
348 radix() - Return Decimal(10), the radix (base) in which the Decimal class does\n \
349 all its arithmetic. Included for compatibility with the specification.\n\
350 \n");
351
352 PyDoc_STRVAR(doc_remainder_near,"\n\
353 remainder_near(other[, context]) - Compute the modulo as either a positive\n\
354 or negative value depending on which is closest to zero. For instance,\n\
355 Decimal(10).remainder_near(6) returns Decimal('-2'), which is closer to zero\n\
356 than Decimal('4').\n\
357 \n\
358 If both are equally close, the one chosen will have the same sign as self.\n\
359 \n");
360
361 PyDoc_STRVAR(doc_rotate,"\n\
362 rotate(other[, context]) - Return the result of rotating the digits of the\n\
363 first operand by an amount specified by the second operand. The second operand\n \
364 must be an integer in the range -precision through precision. The absolute\n\
365 value of the second operand gives the number of places to rotate. If the second\ n\
366 operand is positive then rotation is to the left; otherwise rotation is to the\n \
367 right. The coefficient of the first operand is padded on the left with zeros to\ n\
368 length precision if necessary. The sign and exponent of the first operand are\n\
369 unchanged.\n\
370 \n");
371
372 PyDoc_STRVAR(doc_same_quantum,"\n\
373 same_quantum(other[, context]) - Test whether self and other have the\n\
374 same exponent or whether both are NaN.\n\
375 \n");
376
377 PyDoc_STRVAR(doc_scaleb,"\n\
378 scaleb(other[, context]) - Return the first operand with the exponent adjusted\n \
379 the second. Equivalently, return the first operand multiplied by 10**other.\n\
380 The second operand must be an integer.\n\
381 \n");
382
383 PyDoc_STRVAR(doc_shift,"\n\
384 shift(other[, context]) - Return the result of shifting the digits of\n\
385 the first operand by an amount specified by the second operand. The second\n\
386 operand must be an integer in the range -precision through precision. The\n\
387 absolute value of the second operand gives the number of places to shift.\n\
388 If the second operand is positive, then the shift is to the left; otherwise\n\
389 the shift is to the right. Digits shifted into the coefficient are zeros.\n\
390 The sign and exponent of the first operand are unchanged.\n\
391 \n");
392
393 PyDoc_STRVAR(doc_sqrt,"\n\
394 sqrt([context]) - Return the square root of the argument to full precision.\n\
395 The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\
396 \n");
397
398 PyDoc_STRVAR(doc_to_eng_string,"\n\
399 to_eng_string([context]) - Convert to an engineering-type string.\n\
400 Engineering notation has an exponent which is a multiple of 3, so\n\
401 there are up to 3 digits left of the decimal place. For example,\n\
402 Decimal('123E+1') is converted to Decimal('1.23E+3')\n\
403 \n");
404
405 PyDoc_STRVAR(doc_to_integral,"\n\
406 to_integral([rounding[, context]]) - Identical to the to_integral_value()\n\
407 method. The to_integral name has been kept for compatibility with older\n\
408 versions.\n\
409 \n");
410
411 PyDoc_STRVAR(doc_to_integral_exact,"\n\
412 to_integral_exact([rounding[, context]]) - Round to the nearest integer,\n\
413 signaling Inexact or Rounded as appropriate if rounding occurs. The rounding\n\
414 mode is determined by the rounding parameter if given, else by the given\n\
415 context. If neither parameter is given, then the rounding mode of the current\n\
416 default context is used.\n\
417 \n");
418
419 PyDoc_STRVAR(doc_to_integral_value,"\n\
420 to_integral_value([rounding[, context]]) - Round to the nearest integer without\ n\
421 signaling Inexact or Rounded. The rounding mode is determined by the rounding\n\
422 parameter if given, else by the given context. If neither parameter is given,\n\
423 then the rounding mode of the current default context is used.\n\
424 \n");
425
426
427 /******************************************************************************/
428 /* Context Object and Methods */
429 /******************************************************************************/
430
431 PyDoc_STRVAR(doc_context,"\n\
432 The context affects almost all operations and controls rounding,\n\
433 Over/Underflow, raising of exceptions and much more. A new context\n\
434 can be constructed as follows:\n\
435 \n\
436 >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,\n\
437 ... rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,\n\
438 ... traps=[InvalidOperation, DivisionByZero, Overflow],\n\
439 ... flags=[], _allcr=1)\n\
440 >>>\n\
441 \n\
442 \n");
443
444 #ifdef EXTRA_FUNCTIONALITY
445 PyDoc_STRVAR(doc_ctx_apply,"\n\
446 apply(x) - Apply self to Decimal x.\n\
447 \n");
448 #endif
449
450 PyDoc_STRVAR(doc_ctx_clear_flags,"\n\
451 clear_flags() - Reset all flags to False.\n\
452 \n");
453
454 PyDoc_STRVAR(doc_ctx_clear_traps,"\n\
455 clear_traps() - Set all traps to False.\n\
456 \n");
457
458 PyDoc_STRVAR(doc_ctx_copy,"\n\
459 copy() - Return a duplicate of the context with all flags cleared.\n\
460 \n");
461
462 PyDoc_STRVAR(doc_ctx_copy_decimal,"\n\
463 copy_decimal(x) - Return a copy of Decimal x.\n\
464 \n");
465
466 PyDoc_STRVAR(doc_ctx_create_decimal,"\n\
467 create_decimal(x) - Create a new Decimal instance from x, using self as the\n\
468 context. Unlike the Decimal constructor, this function observes the context\n\
469 limits.\n\
470 \n");
471
472 PyDoc_STRVAR(doc_ctx_create_decimal_from_float,"\n\
473 create_decimal_from_float(f) - Create a new Decimal instance from float f.\n\
474 Unlike the Decimal.from_float() class method, this function observes the\n\
475 context limits.\n\
476 \n");
477
478 PyDoc_STRVAR(doc_ctx_Etiny,"\n\
479 Etiny() - Return a value equal to Emin - prec + 1, which is the minimum\n\
480 exponent value for subnormal results. When underflow occurs, the exponent\n\
481 is set to Etiny.\n\
482 \n");
483
484 PyDoc_STRVAR(doc_ctx_Etop,"\n\
485 Etop() - Return a value equal to Emax - prec + 1. This is the maximum exponent\n \
486 if the _clamp field of the context is set to 1 (IEEE clamp mode). Etop() must\n\
487 not be negative.\n\
488 \n");
489
490 PyDoc_STRVAR(doc_ctx_abs,"\n\
491 abs(x) - Return the absolute value of x.\n\
492 \n");
493
494 PyDoc_STRVAR(doc_ctx_add,"\n\
495 add(x, y) - Return the sum of x and y.\n\
496 \n");
497
498 PyDoc_STRVAR(doc_ctx_canonical,"\n\
499 canonical(x) - Return a new instance of x.\n\
500 \n");
501
502 PyDoc_STRVAR(doc_ctx_compare,"\n\
503 compare(x, y) - Compare x and y numerically.\n\
504 \n");
505
506 PyDoc_STRVAR(doc_ctx_compare_signal,"\n\
507 compare_signal(x, y) - Compare x and y numerically. All NaNs signal.\n\
508 \n");
509
510 PyDoc_STRVAR(doc_ctx_compare_total,"\n\
511 compare_total(x, y) - Compare x and y using their abstract representation.\n\
512 \n");
513
514 PyDoc_STRVAR(doc_ctx_compare_total_mag,"\n\
515 compare_total_mag(x, y) - Compare x and y using their abstract representation,\n \
516 ignoring sign.\n\
517 \n");
518
519 PyDoc_STRVAR(doc_ctx_copy_abs,"\n\
520 copy_abs(x) - Return a copy of x with the sign set to 0.\n\
521 \n");
522
523 PyDoc_STRVAR(doc_ctx_copy_negate,"\n\
524 copy_negate(x) - Return a copy of x with the sign inverted.\n\
525 \n");
526
527 PyDoc_STRVAR(doc_ctx_copy_sign,"\n\
528 copy_sign(x, y) - Copy the sign from y to x.\n\
529 \n");
530
531 PyDoc_STRVAR(doc_ctx_divide,"\n\
532 divide(x, y) - Return x divided by y.\n\
533 \n");
534
535 PyDoc_STRVAR(doc_ctx_divide_int,"\n\
536 divide_int(x, y) - Return x divided by y, truncated to an integer.\n\
537 \n");
538
539 PyDoc_STRVAR(doc_ctx_divmod,"\n\
540 divmod(x, y) - Return quotient and remainder of the division x / y.\n\
541 \n");
542
543 PyDoc_STRVAR(doc_ctx_exp,"\n\
544 exp(x) - Return e ** x.\n\
545 \n");
546
547 PyDoc_STRVAR(doc_ctx_fma,"\n\
548 fma(x, y, z) - Return x multiplied by y, plus z.\n\
549 \n");
550
551 PyDoc_STRVAR(doc_ctx_is_canonical,"\n\
552 is_canonical(x) - Return True if x is canonical, False otherwise.\n\
553 \n");
554
555 PyDoc_STRVAR(doc_ctx_is_finite,"\n\
556 is_finite(x) - Return True if x is finite, False otherwise.\n\
557 \n");
558
559 PyDoc_STRVAR(doc_ctx_is_infinite,"\n\
560 is_infinite(x) - Return True if x is infinite, False otherwise.\n\
561 \n");
562
563 PyDoc_STRVAR(doc_ctx_is_nan,"\n\
564 is_nan(x) - Return True if x is a qNaN or sNaN, False otherwise.\n\
565 \n");
566
567 PyDoc_STRVAR(doc_ctx_is_normal,"\n\
568 is_normal(x) - Return True if x is a normal number, False otherwise.\n\
569 \n");
570
571 PyDoc_STRVAR(doc_ctx_is_qnan,"\n\
572 is_qnan(x) - Return True if x is a quiet NaN, False otherwise.\n\
573 \n");
574
575 PyDoc_STRVAR(doc_ctx_is_signed,"\n\
576 is_signed(x) - Return True if x is negative, False otherwise.\n\
577 \n");
578
579 PyDoc_STRVAR(doc_ctx_is_snan,"\n\
580 is_snan() - Return True if x is a signaling NaN, False otherwise.\n\
581 \n");
582
583 PyDoc_STRVAR(doc_ctx_is_subnormal,"\n\
584 is_subnormal(x) - Return True if x is subnormal, False otherwise.\n\
585 \n");
586
587 PyDoc_STRVAR(doc_ctx_is_zero,"\n\
588 is_zero(x) - Return True if x is a zero, False otherwise.\n\
589 \n");
590
591 PyDoc_STRVAR(doc_ctx_ln,"\n\
592 ln(x) - Return the natural (base e) logarithm of x.\n\
593 \n");
594
595 PyDoc_STRVAR(doc_ctx_log10,"\n\
596 log10(x) - Return the base 10 logarithm of x.\n\
597 \n");
598
599 PyDoc_STRVAR(doc_ctx_logb,"\n\
600 logb(x) - Return the exponent of the magnitude of the operand's MSD.\n\
601 \n");
602
603 PyDoc_STRVAR(doc_ctx_logical_and,"\n\
604 logical_and(x, y) - Digit-wise and of x and y.\n\
605 \n");
606
607 PyDoc_STRVAR(doc_ctx_logical_invert,"\n\
608 logical_invert(x) - Invert all digits of x.\n\
609 \n");
610
611 PyDoc_STRVAR(doc_ctx_logical_or,"\n\
612 logical_or(x, y) - Digit-wise or of x and y.\n\
613 \n");
614
615 PyDoc_STRVAR(doc_ctx_logical_xor,"\n\
616 logical_xor(x, y) - Digit-wise xor of x and y.\n\
617 \n");
618
619 PyDoc_STRVAR(doc_ctx_max,"\n\
620 max(x, y) - Compare the values numerically and return the maximum.\n\
621 \n");
622
623 PyDoc_STRVAR(doc_ctx_max_mag,"\n\
624 max_mag(x, y) - Compare the values numerically with their sign ignored.\n\
625 \n");
626
627 PyDoc_STRVAR(doc_ctx_min,"\n\
628 min(x, y) - Compare the values numerically and return the minimum.\n\
629 \n");
630
631 PyDoc_STRVAR(doc_ctx_min_mag,"\n\
632 min_mag(x, y) - Compare the values numerically with their sign ignored.\n\
633 \n");
634
635 PyDoc_STRVAR(doc_ctx_minus,"\n\
636 minus(x) - Minus corresponds to the unary prefix minus operator in Python,\n\
637 but applies the context to the result.\n\
638 \n");
639
640 PyDoc_STRVAR(doc_ctx_multiply,"\n\
641 multiply(x, y) - Return the product of x and y.\n\
642 \n");
643
644 PyDoc_STRVAR(doc_ctx_next_minus,"\n\
645 next_minus(x) - Return the largest representable number smaller than x.\n\
646 \n");
647
648 PyDoc_STRVAR(doc_ctx_next_plus,"\n\
649 next_plus(x) - Return the smallest representable number larger than x.\n\
650 \n");
651
652 PyDoc_STRVAR(doc_ctx_next_toward,"\n\
653 next_toward(x) - Return the number closest to x, in the direction towards y.\n\
654 \n");
655
656 PyDoc_STRVAR(doc_ctx_normalize,"\n\
657 normalize(x) - Reduce x to its simplest form. Alias for reduce(x).\n\
658 \n");
659
660 PyDoc_STRVAR(doc_ctx_number_class,"\n\
661 number_class(x) - Return an indication of the class of x.\n\
662 \n");
663
664 PyDoc_STRVAR(doc_ctx_plus,"\n\
665 plus(x) - Plus corresponds to the unary prefix plus operator in Python,\n\
666 but applies the context to the result.\n\
667 \n");
668
669 PyDoc_STRVAR(doc_ctx_power,"\n\
670 power(x, y) - Compute x**y. If x is negative, then y must be integral.\n\
671 The result will be inexact unless y is integral and the result is finite\n\
672 and can be expressed exactly in 'precision' digits.\n\
673 \n\
674 power(x, y, m) - Compute (x**y) % m. The following restrictions hold:\n\
675 \n\
676 * all three arguments must be integral\n\
677 * y must be nonnegative\n\
678 * at least one of x or y must be nonzero\n\
679 * m must be nonzero and less than 10**prec in absolute value\n\
680 \n\
681 \n");
682
683 PyDoc_STRVAR(doc_ctx_quantize,"\n\
684 quantize(x, y) - Return a value equal to x (rounded), having the exponent of y.\ n\
685 \n");
686
687 PyDoc_STRVAR(doc_ctx_radix,"\n\
688 radix() - Return 10.\n\
689 \n");
690
691 PyDoc_STRVAR(doc_ctx_remainder,"\n\
692 remainder(x, y) - Return the remainder from integer division. The sign of\n\
693 the result, if non-zero, is the same as that of the original dividend.\n\
694 \n");
695
696 PyDoc_STRVAR(doc_ctx_remainder_near,"\n\
697 remainder_near(x, y) - Return x - y * n, where n is the integer nearest the\n\
698 exact value of x / y (if the result is 0 then its sign will be the sign of x).\n \
699 \n");
700
701 PyDoc_STRVAR(doc_ctx_rotate,"\n\
702 rotate(x, y) - Return a copy of x, rotated by y places.\n\
703 \n");
704
705 PyDoc_STRVAR(doc_ctx_same_quantum,"\n\
706 same_quantum(x, y) - Return True if the two operands have the same exponent.\n\
707 \n");
708
709 PyDoc_STRVAR(doc_ctx_scaleb,"\n\
710 scaleb(x, y) - Return the first operand after adding the second value\n\
711 to its exp.\n\
712 \n");
713
714 PyDoc_STRVAR(doc_ctx_shift,"\n\
715 shift(x, y) - Return a copy of x, shifted by y places.\n\
716 \n");
717
718 PyDoc_STRVAR(doc_ctx_sqrt,"\n\
719 sqrt(x) - Square root of a non-negative number to context precision.\n\
720 \n");
721
722 PyDoc_STRVAR(doc_ctx_subtract,"\n\
723 subtract(x, y) - Return the difference between x and y.\n\
724 \n");
725
726 PyDoc_STRVAR(doc_ctx_to_eng_string,"\n\
727 to_eng_string(x) - Convert a number to a string, using engineering notation.\n\
728 \n");
729
730 PyDoc_STRVAR(doc_ctx_to_integral,"\n\
731 to_integral(x) - Identical to to_integral_value(x).\n\
732 \n");
733
734 PyDoc_STRVAR(doc_ctx_to_integral_exact,"\n\
735 to_integral_exact(x) - Round to an integer. Signal if the result is\n\
736 rounded or inexact.\n\
737 \n");
738
739 PyDoc_STRVAR(doc_ctx_to_integral_value,"\n\
740 to_integral_value(x) - Round to an integer.\n\
741 \n");
742
743 PyDoc_STRVAR(doc_ctx_to_sci_string,"\n\
744 to_sci_string(x) - Convert a number to a string using scientific notation.\n\
745 \n");
746
747
748 #endif /* DOCSTRINGS_H */
749
750
751
OLDNEW
« no previous file with comments | « Modules/_decimal/_decimal.c ('k') | Modules/_decimal/ISSUES.txt » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+