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

Delta Between Two Patch Sets: Modules/_decimal/docstrings.h

Issue 7652: Merge C version of decimal into py3k.
Left Patch Set: Created 8 years, 2 months ago
Right Patch Set: Created 7 years, 5 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Modules/_decimal/_decimal.c ('k') | Modules/_decimal/ISSUES.txt » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * Copyright (c) 2001-2010 Python Software Foundation. All Rights Reserved. 2 * Copyright (c) 2001-2010 Python Software Foundation. All Rights Reserved.
3 * Modified and extended by Stefan Krah. 3 * Modified and extended by Stefan Krah.
4 */ 4 */
5 5
6 6
7 #ifndef DOCSTRINGS_H 7 #ifndef DOCSTRINGS_H
8 #define DOCSTRINGS_H 8 #define DOCSTRINGS_H
9 9
10 10
11 #include "Python.h" 11 #include "pymacro.h"
12 12
13 13
14 /******************************************************************************/ 14 /******************************************************************************/
15 /* Module */ 15 /* Module */
16 /******************************************************************************/ 16 /******************************************************************************/
17 17
18 18
19 PyDoc_STRVAR(doc__decimal, 19 PyDoc_STRVAR(doc__decimal,
20 "C decimal arithmetic module"); 20 "C decimal arithmetic module");
21 21
22 PyDoc_STRVAR(doc_getcontext,"\n\ 22 PyDoc_STRVAR(doc_getcontext,"\n\
23 getcontext() - Get the current default context.\n\ 23 getcontext() - Get the current default context.\n\
24 \n"); 24 \n");
25 25
26 PyDoc_STRVAR(doc_setcontext,"\n\ 26 PyDoc_STRVAR(doc_setcontext,"\n\
27 setcontext(c) - Set a new default context.\n\ 27 setcontext(c) - Set a new default context.\n\
28 \n"); 28 \n");
29 29
30 PyDoc_STRVAR(doc_localcontext,"\n\ 30 PyDoc_STRVAR(doc_localcontext,"\n\
31 localcontext(c) - Return a context manager that will set the default context\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 \ 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 \ 33 context when exiting the with-statement. If no context is specified, a copy of\n \
34 the current default context is used.\n\ 34 the current default context is used.\n\
35 \n"); 35 \n");
36 36
37 #ifdef EXTRA_FUNCTIONALITY
37 PyDoc_STRVAR(doc_ieee_context,"\n\ 38 PyDoc_STRVAR(doc_ieee_context,"\n\
38 IEEEContext(bits) - Return a context object initialized to the proper values for \n\ 39 IEEEContext(bits) - Return a context object initialized to the proper values for \n\
39 one of the IEEE interchange formats. The argument must be a multiple of 32 and\n \ 40 one of the IEEE interchange formats. The argument must be a multiple of 32 and\n \
40 less than IEEE_CONTEXT_MAX_BITS. For the most common values, the constants\n\ 41 less than IEEE_CONTEXT_MAX_BITS. For the most common values, the constants\n\
41 DECIMAL32, DECIMAL64 and DECIMAL128 are provided.\n\ 42 DECIMAL32, DECIMAL64 and DECIMAL128 are provided.\n\
42 \n"); 43 \n");
44 #endif
43 45
44 46
45 /******************************************************************************/ 47 /******************************************************************************/
46 /* Decimal Object and Methods */ 48 /* Decimal Object and Methods */
47 /******************************************************************************/ 49 /******************************************************************************/
48 50
49 PyDoc_STRVAR(doc_decimal,"\n\ 51 PyDoc_STRVAR(doc_decimal,"\n\
50 Decimal([value[, context]]): Construct a new Decimal object from value.\n\ 52 Decimal([value[, context]]): Construct a new Decimal object from value.\n\
51 \n\ 53 \n\
52 value can be an integer, string, tuple, or another Decimal object.\n\ 54 value can be an integer, string, tuple, or another Decimal object.\n\
53 If no value is given, return Decimal('0'). The context does not affect\n\ 55 If no value is given, return Decimal('0'). The context does not affect\n\
54 the conversion and is only passed to determine if the InvalidOperation\n\ 56 the conversion and is only passed to determine if the InvalidOperation\n\
55 trap is active.\n\ 57 trap is active.\n\
56 \n");
57
58 PyDoc_STRVAR(doc_abs,"\n\
59 abs() - Return the absolute value of the number.\n\
60 \n"); 58 \n");
61 59
62 PyDoc_STRVAR(doc_adjusted,"\n\ 60 PyDoc_STRVAR(doc_adjusted,"\n\
63 adjusted() - Return the adjusted exponent of the number.\n\ 61 adjusted() - Return the adjusted exponent of the number.\n\
64 \n\ 62 \n\
65 Defined as exp + digits - 1.\n\ 63 Defined as exp + digits - 1.\n\
66 \n"); 64 \n");
67 65
68 PyDoc_STRVAR(doc_as_tuple,"\n\ 66 PyDoc_STRVAR(doc_as_tuple,"\n\
69 as_tuple() - Return a tuple representation of the number.\n\ 67 as_tuple() - Return a tuple representation of the number.\n\
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 202
205 PyDoc_STRVAR(doc_is_signed,"\n\ 203 PyDoc_STRVAR(doc_is_signed,"\n\
206 is_signed() - Return True if the argument has a negative sign and\n\ 204 is_signed() - Return True if the argument has a negative sign and\n\
207 False otherwise. Note that both zeros and NaNs can carry signs.\n\ 205 False otherwise. Note that both zeros and NaNs can carry signs.\n\
208 \n"); 206 \n");
209 207
210 PyDoc_STRVAR(doc_is_snan,"\n\ 208 PyDoc_STRVAR(doc_is_snan,"\n\
211 is_snan() - Return True if the argument is a signaling NaN and False otherwise.\ n\ 209 is_snan() - Return True if the argument is a signaling NaN and False otherwise.\ n\
212 \n"); 210 \n");
213 211
214 PyDoc_STRVAR(doc_is_special,"\n\
215 is_special() - Return True if the argument is either NaN, sNaN or Infinity\n\
216 and False otherwise.\n\
217 \n");
218
219 PyDoc_STRVAR(doc_is_subnormal,"\n\ 212 PyDoc_STRVAR(doc_is_subnormal,"\n\
220 is_subnormal([context]) - Return True if the argument is subnormal, and False\n\ 213 is_subnormal([context]) - Return True if the argument is subnormal, and False\n\
221 otherwise. A number is subnormal if it is non-zero, finite, and has an\n\ 214 otherwise. A number is subnormal if it is non-zero, finite, and has an\n\
222 adjusted exponent less than Emin.\n\ 215 adjusted exponent less than Emin.\n\
223 \n"); 216 \n");
224 217
225 PyDoc_STRVAR(doc_is_zero,"\n\ 218 PyDoc_STRVAR(doc_is_zero,"\n\
226 is_zero() - Return True if the argument is a (positive or negative) zero and\n\ 219 is_zero() - Return True if the argument is a (positive or negative) zero and\n\
227 False otherwise.\n\ 220 False otherwise.\n\
228 \n"); 221 \n");
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 If both operands are numerically equal, return a copy of the first operand\n\ 297 If both operands are numerically equal, return a copy of the first operand\n\
305 with the sign set to be the same as the sign of the second operand.\n\ 298 with the sign set to be the same as the sign of the second operand.\n\
306 \n"); 299 \n");
307 300
308 PyDoc_STRVAR(doc_normalize,"\n\ 301 PyDoc_STRVAR(doc_normalize,"\n\
309 normalize([context]) - Normalize the number by stripping the rightmost trailing\ n\ 302 normalize([context]) - Normalize the number by stripping the rightmost trailing\ n\
310 zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\ 303 zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\
311 for producing canonical values for members of an equivalence class. For example, \n\ 304 for producing canonical values for members of an equivalence class. For example, \n\
312 Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent\n\ 305 Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent\n\
313 value Decimal('32.1').\n\ 306 value Decimal('32.1').\n\
314 \n\
315 Normalize is an alias for reduce([context]).\n\
316 \n"); 307 \n");
317 308
318 PyDoc_STRVAR(doc_number_class,"\n\ 309 PyDoc_STRVAR(doc_number_class,"\n\
319 number_class([context]) - Return a string describing the class of the operand.\n \ 310 number_class([context]) - Return a string describing the class of the operand.\n \
320 The returned value is one of the following ten strings:\n\ 311 The returned value is one of the following ten strings:\n\
321 \n\ 312 \n\
322 * '-Infinity', indicating that the operand is negative infinity.\n\ 313 * '-Infinity', indicating that the operand is negative infinity.\n\
323 * '-Normal', indicating that the operand is a negative normal number.\n\ 314 * '-Normal', indicating that the operand is a negative normal number.\n\
324 * '-Subnormal', indicating that the operand is negative and subnormal.\n\ 315 * '-Subnormal', indicating that the operand is negative and subnormal.\n\
325 * '-Zero', indicating that the operand is a negative zero.\n\ 316 * '-Zero', indicating that the operand is a negative zero.\n\
(...skipping 17 matching lines...) Expand all
343 operation would be greater than precision, then an InvalidOperation is signaled. \n\ 334 operation would be greater than precision, then an InvalidOperation is signaled. \n\
344 This guarantees that, unless there is an error condition, the quantized exponent \n\ 335 This guarantees that, unless there is an error condition, the quantized exponent \n\
345 is always equal to that of the right-hand operand.\n\ 336 is always equal to that of the right-hand operand.\n\
346 \n\ 337 \n\
347 Also unlike other operations, quantize never signals Underflow, even if the\n\ 338 Also unlike other operations, quantize never signals Underflow, even if the\n\
348 result is subnormal and inexact.\n\ 339 result is subnormal and inexact.\n\
349 \n\ 340 \n\
350 If the exponent of the second operand is larger than that of the first, then\n\ 341 If the exponent of the second operand is larger than that of the first, then\n\
351 rounding may be necessary. In this case, the rounding mode is determined by the\ n\ 342 rounding may be necessary. In this case, the rounding mode is determined by the\ n\
352 rounding argument if given, else by the given context argument; if neither\n\ 343 rounding argument if given, else by the given context argument; if neither\n\
353 argument is given, the rounding mode of the current threads context is used.\n\ 344 argument is given, the rounding mode of the current thread's context is used.\n\
354 \n"); 345 \n");
355 346
356 PyDoc_STRVAR(doc_radix,"\n\ 347 PyDoc_STRVAR(doc_radix,"\n\
357 radix() - Return Decimal(10), the radix (base) in which the Decimal class does\n \ 348 radix() - Return Decimal(10), the radix (base) in which the Decimal class does\n \
358 all its arithmetic. Included for compatibility with the specification.\n\ 349 all its arithmetic. Included for compatibility with the specification.\n\
359 \n");
360
361 PyDoc_STRVAR(doc_reduce,"\n\
362 reduce([context]) - Normalize the number by stripping the rightmost trailing\n\
363 zeros and converting any result equal to Decimal('0') to Decimal('0e0'). Used\n\
364 for producing canonical values for members of an equivalence class. For example, \n\
365 Decimal('32.100') and Decimal('0.321000e+2') both normalize to the equivalent\n\
366 value Decimal('32.1').\n\
367 \n"); 350 \n");
368 351
369 PyDoc_STRVAR(doc_remainder_near,"\n\ 352 PyDoc_STRVAR(doc_remainder_near,"\n\
370 remainder_near(other[, context]) - Compute the modulo as either a positive\n\ 353 remainder_near(other[, context]) - Compute the modulo as either a positive\n\
371 or negative value depending on which is closest to zero. For instance,\n\ 354 or negative value depending on which is closest to zero. For instance,\n\
372 Decimal(10).remainder_near(6) returns Decimal('-2'), which is closer to zero\n\ 355 Decimal(10).remainder_near(6) returns Decimal('-2'), which is closer to zero\n\
373 than Decimal('4').\n\ 356 than Decimal('4').\n\
374 \n\ 357 \n\
375 If both are equally close, the one chosen will have the same sign as self.\n\ 358 If both are equally close, the one chosen will have the same sign as self.\n\
376 \n"); 359 \n");
(...skipping 28 matching lines...) Expand all
405 If the second operand is positive, then the shift is to the left; otherwise\n\ 388 If the second operand is positive, then the shift is to the left; otherwise\n\
406 the shift is to the right. Digits shifted into the coefficient are zeros.\n\ 389 the shift is to the right. Digits shifted into the coefficient are zeros.\n\
407 The sign and exponent of the first operand are unchanged.\n\ 390 The sign and exponent of the first operand are unchanged.\n\
408 \n"); 391 \n");
409 392
410 PyDoc_STRVAR(doc_sqrt,"\n\ 393 PyDoc_STRVAR(doc_sqrt,"\n\
411 sqrt([context]) - Return the square root of the argument to full precision.\n\ 394 sqrt([context]) - Return the square root of the argument to full precision.\n\
412 The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\ 395 The result is correctly rounded using the ROUND_HALF_EVEN rounding mode.\n\
413 \n"); 396 \n");
414 397
415 PyDoc_STRVAR(doc_to_eng,"\n\
416 to_eng([context]) - Convert a number to a string using engineering\n\
417 notation. Alias for to_eng_string().\n\
418 \n");
419
420 PyDoc_STRVAR(doc_to_eng_string,"\n\ 398 PyDoc_STRVAR(doc_to_eng_string,"\n\
421 to_eng_string([context]) - Convert to an engineering-type string.\n\ 399 to_eng_string([context]) - Convert to an engineering-type string.\n\
422 Engineering notation has an exponent which is a multiple of 3, so\n\ 400 Engineering notation has an exponent which is a multiple of 3, so\n\
423 there are up to 3 digits left of the decimal place. For example,\n\ 401 there are up to 3 digits left of the decimal place. For example,\n\
424 Decimal('123E+1') is converted to Decimal('1.23E+3')\n\ 402 Decimal('123E+1') is converted to Decimal('1.23E+3')\n\
425 \n"); 403 \n");
426 404
427 PyDoc_STRVAR(doc_to_integral,"\n\ 405 PyDoc_STRVAR(doc_to_integral,"\n\
428 to_integral([rounding[, context]]) - Identical to the to_integral_value()\n\ 406 to_integral([rounding[, context]]) - Identical to the to_integral_value()\n\
429 method. The to_integral name has been kept for compatibility with older\n\ 407 method. The to_integral name has been kept for compatibility with older\n\
(...skipping 10 matching lines...) Expand all
440 418
441 PyDoc_STRVAR(doc_to_integral_value,"\n\ 419 PyDoc_STRVAR(doc_to_integral_value,"\n\
442 to_integral_value([rounding[, context]]) - Round to the nearest integer without\ n\ 420 to_integral_value([rounding[, context]]) - Round to the nearest integer without\ n\
443 signaling Inexact or Rounded. The rounding mode is determined by the rounding\n\ 421 signaling Inexact or Rounded. The rounding mode is determined by the rounding\n\
444 parameter if given, else by the given context. If neither parameter is given,\n\ 422 parameter if given, else by the given context. If neither parameter is given,\n\
445 then the rounding mode of the current default context is used.\n\ 423 then the rounding mode of the current default context is used.\n\
446 \n"); 424 \n");
447 425
448 426
449 /******************************************************************************/ 427 /******************************************************************************/
450 /* Decimal Object, Additional Methods */
451 /******************************************************************************/
452
453 PyDoc_STRVAR(doc_add,"\n\
454 add(other[, context]) - Return the sum of self and other.\n\
455 \n");
456
457 PyDoc_STRVAR(doc_apply,"\n\
458 apply() - Apply the default context to the number.\n\
459 \n");
460
461 PyDoc_STRVAR(doc_div,"\n\
462 div(other[, context]) - Divide self by other.\n\
463 Alias for divide(other[, context]).\n\
464 \n");
465
466 PyDoc_STRVAR(doc_divide,"\n\
467 divide(other[, context]) - Divide self by other.\n\
468 \n");
469
470 PyDoc_STRVAR(doc_divide_int,"\n\
471 divide_int(other[, context]) - Truncating division.\n\
472 \n");
473
474 PyDoc_STRVAR(doc_divint,"\n\
475 divint(other[, context]) - Truncating division.\n\
476 Alias for divide_int(other[, context]).\n\
477 \n");
478
479 PyDoc_STRVAR(doc_divmod,"\n\
480 divmod(other[, context]) - Return quotient and remainder of the\n\
481 division self / other.\n\
482 \n");
483
484 PyDoc_STRVAR(doc_invroot,"\n\
485 invroot([context]) - Return the reciprocal of the square root.\n\
486 \n");
487
488 PyDoc_STRVAR(doc_is_integer,"\n\
489 is_integer() - Return True if the argument is an integer and False otherwise.\n\
490 \n");
491
492 PyDoc_STRVAR(doc_minus,"\n\
493 minus() - Minus corresponds to the unary prefix minus operator in Python,\n\
494 but applies the context precision and rounding.\n\
495 \n");
496
497 PyDoc_STRVAR(doc_mul,"\n\
498 mul(other[, context]) - Multiply self by other.\n\
499 Alias for multiply(other[, context]).\n\
500 \n");
501
502 PyDoc_STRVAR(doc_multiply,"\n\
503 multiply(other[, context]) - Multiply self by other.\n\
504 \n");
505
506 PyDoc_STRVAR(doc_plus,"\n\
507 plus() - Plus corresponds to the unary prefix plus operator in Python,\n\
508 but applies the context precision and rounding.\n\
509 \n");
510
511 PyDoc_STRVAR(doc_pow,"\n\
512 pow(other[, context]) - Raise self to the power of other.\n\
513 Alias for power(other[, context]).\n\
514 \n");
515
516 PyDoc_STRVAR(doc_power,"\n\
517 power(other[, context]) - Raise self to the power of other.\n\
518 \n");
519
520 PyDoc_STRVAR(doc_powmod,"\n\
521 powmod(other, third[, context]) - Return (self ** other) % third.\n\
522 \n");
523
524 PyDoc_STRVAR(doc_rem,"\n\
525 rem(other[, context]) - Remainder of the division self / other.\n\
526 Alias for remainder(other[, context]).\n\
527 \n");
528
529 PyDoc_STRVAR(doc_remainder,"\n\
530 remainder(other[, context]) - Remainder of the division self / other.\n\
531 \n");
532
533 PyDoc_STRVAR(doc_sub,"\n\
534 sub(other[, context]) - Subtract other from self.\n\
535 Alias for subtract(other[, context]).\n\
536 \n");
537
538 PyDoc_STRVAR(doc_subtract,"\n\
539 subtract(other[, context]) - Subtract other from self.\n\
540 \n");
541
542 PyDoc_STRVAR(doc_sign,"\n\
543 sign() - Return -1 or 1, depending on the sign of self.\n\
544 \n");
545
546 PyDoc_STRVAR(doc_to_sci,"\n\
547 to_sci([context]) - Convert a number to a string using scientific notation.\n\
548 Alias for to_sci_string().\n\
549 \n");
550
551 PyDoc_STRVAR(doc_to_sci_string,"\n\
552 to_sci_string([context]) - Convert a number to a string using\n\
553 scientific notation.\n\
554 \n");
555
556
557 /******************************************************************************/
558 /* Context Object and Methods */ 428 /* Context Object and Methods */
559 /******************************************************************************/ 429 /******************************************************************************/
560 430
561 PyDoc_STRVAR(doc_context,"\n\ 431 PyDoc_STRVAR(doc_context,"\n\
562 The context affects almost all operations and controls rounding,\n\ 432 The context affects almost all operations and controls rounding,\n\
563 Over/Underflow, raising of exceptions and much more. A new context\n\ 433 Over/Underflow, raising of exceptions and much more. A new context\n\
564 can be constructed as follows:\n\ 434 can be constructed as follows:\n\
565 \n\ 435 \n\
566 >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,\n\ 436 >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,\n\
567 ... rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,\n\ 437 ... rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,\n\
568 ... traps=[InvalidOperation, DivisionByZero, Overflow],\n\ 438 ... traps=[InvalidOperation, DivisionByZero, Overflow],\n\
569 ... flags=[], _allcr=1)\n\ 439 ... flags=[], _allcr=1)\n\
570 >>>\n\ 440 >>>\n\
571 \n\ 441 \n\
572 \n"); 442 \n");
573 443
444 #ifdef EXTRA_FUNCTIONALITY
574 PyDoc_STRVAR(doc_ctx_apply,"\n\ 445 PyDoc_STRVAR(doc_ctx_apply,"\n\
575 apply(x) - Apply self to Decimal x.\n\ 446 apply(x) - Apply self to Decimal x.\n\
576 \n"); 447 \n");
448 #endif
577 449
578 PyDoc_STRVAR(doc_ctx_clear_flags,"\n\ 450 PyDoc_STRVAR(doc_ctx_clear_flags,"\n\
579 clear_flags() - Reset all flags to False.\n\ 451 clear_flags() - Reset all flags to False.\n\
580 \n"); 452 \n");
581 453
582 PyDoc_STRVAR(doc_ctx_clear_traps,"\n\ 454 PyDoc_STRVAR(doc_ctx_clear_traps,"\n\
583 clear_traps() - Set all traps to False.\n\ 455 clear_traps() - Set all traps to False.\n\
584 \n"); 456 \n");
585 457
586 PyDoc_STRVAR(doc_ctx_copy,"\n\ 458 PyDoc_STRVAR(doc_ctx_copy,"\n\
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 \n"); 521 \n");
650 522
651 PyDoc_STRVAR(doc_ctx_copy_negate,"\n\ 523 PyDoc_STRVAR(doc_ctx_copy_negate,"\n\
652 copy_negate(x) - Return a copy of x with the sign inverted.\n\ 524 copy_negate(x) - Return a copy of x with the sign inverted.\n\
653 \n"); 525 \n");
654 526
655 PyDoc_STRVAR(doc_ctx_copy_sign,"\n\ 527 PyDoc_STRVAR(doc_ctx_copy_sign,"\n\
656 copy_sign(x, y) - Copy the sign from y to x.\n\ 528 copy_sign(x, y) - Copy the sign from y to x.\n\
657 \n"); 529 \n");
658 530
659 PyDoc_STRVAR(doc_ctx_div,"\n\
660 div(x, y) - Return x divided by y. Alias for divide(x, y).\n\
661 \n");
662
663 PyDoc_STRVAR(doc_ctx_divide,"\n\ 531 PyDoc_STRVAR(doc_ctx_divide,"\n\
664 divide(x, y) - Return x divided by y.\n\ 532 divide(x, y) - Return x divided by y.\n\
665 \n"); 533 \n");
666 534
667 PyDoc_STRVAR(doc_ctx_divide_int,"\n\ 535 PyDoc_STRVAR(doc_ctx_divide_int,"\n\
668 divide_int(x, y) - Return x divided by y, truncated to an integer.\n\ 536 divide_int(x, y) - Return x divided by y, truncated to an integer.\n\
669 \n");
670
671 PyDoc_STRVAR(doc_ctx_divint,"\n\
672 divint(x, y) - Return x divided by y, truncated to an integer.\n\
673 Alias for divide_int(x, y).\n\
674 \n"); 537 \n");
675 538
676 PyDoc_STRVAR(doc_ctx_divmod,"\n\ 539 PyDoc_STRVAR(doc_ctx_divmod,"\n\
677 divmod(x, y) - Return quotient and remainder of the division x / y.\n\ 540 divmod(x, y) - Return quotient and remainder of the division x / y.\n\
678 \n"); 541 \n");
679 542
680 PyDoc_STRVAR(doc_ctx_exp,"\n\ 543 PyDoc_STRVAR(doc_ctx_exp,"\n\
681 exp(x) - Return e ** x.\n\ 544 exp(x) - Return e ** x.\n\
682 \n"); 545 \n");
683 546
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 630
768 PyDoc_STRVAR(doc_ctx_min_mag,"\n\ 631 PyDoc_STRVAR(doc_ctx_min_mag,"\n\
769 min_mag(x, y) - Compare the values numerically with their sign ignored.\n\ 632 min_mag(x, y) - Compare the values numerically with their sign ignored.\n\
770 \n"); 633 \n");
771 634
772 PyDoc_STRVAR(doc_ctx_minus,"\n\ 635 PyDoc_STRVAR(doc_ctx_minus,"\n\
773 minus(x) - Minus corresponds to the unary prefix minus operator in Python,\n\ 636 minus(x) - Minus corresponds to the unary prefix minus operator in Python,\n\
774 but applies the context to the result.\n\ 637 but applies the context to the result.\n\
775 \n"); 638 \n");
776 639
777 PyDoc_STRVAR(doc_ctx_mul,"\n\
778 mul(x, y) - Return the product of x and y. Alias for multiply(x, y).\n\
779 \n");
780
781 PyDoc_STRVAR(doc_ctx_multiply,"\n\ 640 PyDoc_STRVAR(doc_ctx_multiply,"\n\
782 multiply(x, y) - Return the product of x and y.\n\ 641 multiply(x, y) - Return the product of x and y.\n\
783 \n"); 642 \n");
784 643
785 PyDoc_STRVAR(doc_ctx_next_minus,"\n\ 644 PyDoc_STRVAR(doc_ctx_next_minus,"\n\
786 next_minus(x) - Return the largest representable number smaller than x.\n\ 645 next_minus(x) - Return the largest representable number smaller than x.\n\
787 \n"); 646 \n");
788 647
789 PyDoc_STRVAR(doc_ctx_next_plus,"\n\ 648 PyDoc_STRVAR(doc_ctx_next_plus,"\n\
790 next_plus(x) - Return the smallest representable number larger than x.\n\ 649 next_plus(x) - Return the smallest representable number larger than x.\n\
791 \n"); 650 \n");
792 651
793 PyDoc_STRVAR(doc_ctx_next_toward,"\n\ 652 PyDoc_STRVAR(doc_ctx_next_toward,"\n\
794 next_toward(x) - Return the number closest to x, in the direction towards y.\n\ 653 next_toward(x) - Return the number closest to x, in the direction towards y.\n\
795 \n"); 654 \n");
796 655
797 PyDoc_STRVAR(doc_ctx_normalize,"\n\ 656 PyDoc_STRVAR(doc_ctx_normalize,"\n\
798 normalize(x) - Reduce x to its simplest form. Alias for reduce(x).\n\ 657 normalize(x) - Reduce x to its simplest form. Alias for reduce(x).\n\
799 \n"); 658 \n");
800 659
801 PyDoc_STRVAR(doc_ctx_number_class,"\n\ 660 PyDoc_STRVAR(doc_ctx_number_class,"\n\
802 number_class(x) - Return an indication of the class of x.\n\ 661 number_class(x) - Return an indication of the class of x.\n\
803 \n"); 662 \n");
804 663
805 PyDoc_STRVAR(doc_ctx_plus,"\n\ 664 PyDoc_STRVAR(doc_ctx_plus,"\n\
806 plus(x) - Plus corresponds to the unary prefix plus operator in Python,\n\ 665 plus(x) - Plus corresponds to the unary prefix plus operator in Python,\n\
807 but applies the context to the result.\n\ 666 but applies the context to the result.\n\
808 \n");
809
810 PyDoc_STRVAR(doc_ctx_pow,"\n\
811 pow(x, y) - Compute x**y. Alias for power(x, y).\n\
812 \n"); 667 \n");
813 668
814 PyDoc_STRVAR(doc_ctx_power,"\n\ 669 PyDoc_STRVAR(doc_ctx_power,"\n\
815 power(x, y) - Compute x**y. If x is negative, then y must be integral.\n\ 670 power(x, y) - Compute x**y. If x is negative, then y must be integral.\n\
816 The result will be inexact unless y is integral and the result is finite\n\ 671 The result will be inexact unless y is integral and the result is finite\n\
817 and can be expressed exactly in 'precision' digits.\n\ 672 and can be expressed exactly in 'precision' digits.\n\
818 \n"); 673 \n\
819 674 power(x, y, m) - Compute (x**y) % m. The following restrictions hold:\n\
820 PyDoc_STRVAR(doc_ctx_powmod,"\n\
821 powmod(x, y, m) - Compute (x**y) % m. The following restrictions hold:\n\
822 \n\ 675 \n\
823 * all three arguments must be integral\n\ 676 * all three arguments must be integral\n\
824 * y must be nonnegative\n\ 677 * y must be nonnegative\n\
825 * at least one of x or y must be nonzero\n\ 678 * at least one of x or y must be nonzero\n\
826 * m must be nonzero\n\ 679 * m must be nonzero and less than 10**prec in absolute value\n\
827 \n\ 680 \n\
828 \n"); 681 \n");
829 682
830 PyDoc_STRVAR(doc_ctx_quantize,"\n\ 683 PyDoc_STRVAR(doc_ctx_quantize,"\n\
831 quantize(x, y) - Return a value equal to x (rounded), having the exponent of y.\ n\ 684 quantize(x, y) - Return a value equal to x (rounded), having the exponent of y.\ n\
832 \n"); 685 \n");
833 686
834 PyDoc_STRVAR(doc_ctx_radix,"\n\ 687 PyDoc_STRVAR(doc_ctx_radix,"\n\
835 radix() - Return 10.\n\ 688 radix() - Return 10.\n\
836 \n");
837
838 PyDoc_STRVAR(doc_ctx_reduce,"\n\
839 reduce(x) - Reduce x to its simplest form.\n\
840 \n");
841
842 PyDoc_STRVAR(doc_ctx_rem,"\n\
843 rem(x, y) - Return the remainder from integer division. The sign of\n\
844 the result, if non-zero, is the same as that of the original dividend.\n\
845 \n\
846 Alias for remainder(x, y).\n\
847 \n"); 689 \n");
848 690
849 PyDoc_STRVAR(doc_ctx_remainder,"\n\ 691 PyDoc_STRVAR(doc_ctx_remainder,"\n\
850 remainder(x, y) - Return the remainder from integer division. The sign of\n\ 692 remainder(x, y) - Return the remainder from integer division. The sign of\n\
851 the result, if non-zero, is the same as that of the original dividend.\n\ 693 the result, if non-zero, is the same as that of the original dividend.\n\
852 \n"); 694 \n");
853 695
854 PyDoc_STRVAR(doc_ctx_remainder_near,"\n\ 696 PyDoc_STRVAR(doc_ctx_remainder_near,"\n\
855 remainder_near(x, y) - Return x - y * n, where n is the integer nearest the\n\ 697 remainder_near(x, y) - Return x - y * n, where n is the integer nearest the\n\
856 exact value of x / y (if the result is 0 then its sign will be the sign of x).\n \ 698 exact value of x / y (if the result is 0 then its sign will be the sign of x).\n \
(...skipping 13 matching lines...) Expand all
870 \n"); 712 \n");
871 713
872 PyDoc_STRVAR(doc_ctx_shift,"\n\ 714 PyDoc_STRVAR(doc_ctx_shift,"\n\
873 shift(x, y) - Return a copy of x, shifted by y places.\n\ 715 shift(x, y) - Return a copy of x, shifted by y places.\n\
874 \n"); 716 \n");
875 717
876 PyDoc_STRVAR(doc_ctx_sqrt,"\n\ 718 PyDoc_STRVAR(doc_ctx_sqrt,"\n\
877 sqrt(x) - Square root of a non-negative number to context precision.\n\ 719 sqrt(x) - Square root of a non-negative number to context precision.\n\
878 \n"); 720 \n");
879 721
880 PyDoc_STRVAR(doc_ctx_sub,"\n\
881 sub(x, y) - Return the difference between x and y. Alias for subtract(x, y).\n\
882 \n");
883
884 PyDoc_STRVAR(doc_ctx_subtract,"\n\ 722 PyDoc_STRVAR(doc_ctx_subtract,"\n\
885 subtract(x, y) - Return the difference between x and y.\n\ 723 subtract(x, y) - Return the difference between x and y.\n\
886 \n");
887
888 PyDoc_STRVAR(doc_ctx_to_eng,"\n\
889 to_eng(x) - Convert a number to a string, using engineering notation.\n\
890 Alias for to_eng_string(x).\n\
891 \n"); 724 \n");
892 725
893 PyDoc_STRVAR(doc_ctx_to_eng_string,"\n\ 726 PyDoc_STRVAR(doc_ctx_to_eng_string,"\n\
894 to_eng_string(x) - Convert a number to a string, using engineering notation.\n\ 727 to_eng_string(x) - Convert a number to a string, using engineering notation.\n\
895 \n"); 728 \n");
896 729
897 PyDoc_STRVAR(doc_ctx_to_integral,"\n\ 730 PyDoc_STRVAR(doc_ctx_to_integral,"\n\
898 to_integral(x) - Identical to to_integral_value(x).\n\ 731 to_integral(x) - Identical to to_integral_value(x).\n\
899 \n"); 732 \n");
900 733
901 PyDoc_STRVAR(doc_ctx_to_integral_exact,"\n\ 734 PyDoc_STRVAR(doc_ctx_to_integral_exact,"\n\
902 to_integral_exact(x) - Round to an integer. Signal if the result is\n\ 735 to_integral_exact(x) - Round to an integer. Signal if the result is\n\
903 rounded or inexact.\n\ 736 rounded or inexact.\n\
904 \n"); 737 \n");
905 738
906 PyDoc_STRVAR(doc_ctx_to_integral_value,"\n\ 739 PyDoc_STRVAR(doc_ctx_to_integral_value,"\n\
907 to_integral_value(x) - Round to an integer.\n\ 740 to_integral_value(x) - Round to an integer.\n\
908 \n"); 741 \n");
909 742
910 PyDoc_STRVAR(doc_ctx_to_sci,"\n\
911 to_sci(x) - Convert a number to a string using scientific notation.\n\
912 Alias for to_sci_string(x).\n\
913 \n");
914
915 PyDoc_STRVAR(doc_ctx_to_sci_string,"\n\ 743 PyDoc_STRVAR(doc_ctx_to_sci_string,"\n\
916 to_sci_string(x) - Convert a number to a string using scientific notation.\n\ 744 to_sci_string(x) - Convert a number to a string using scientific notation.\n\
917 \n"); 745 \n");
918 746
919 /******************************************************************************/ 747
920 /* Context Object, Additional Methods */ 748 #endif /* DOCSTRINGS_H */
921 /******************************************************************************/ 749
922 750
923 PyDoc_STRVAR(doc_ctx_invroot,"\n\ 751
924 invroot(x) - Return the reciprocal of the square root of x.\n\
925 \n");
926
927 PyDoc_STRVAR(doc_ctx_setflags,"\n\
928 setflags(list) - Set the context flags from a list containing signals.\n\
929 \n");
930
931 PyDoc_STRVAR(doc_ctx_settraps,"\n\
932 settraps(list) - Set the context traps from a list containing signals.\n\
933 \n");
934
935
936 #endif
937
938
939
LEFTRIGHT

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