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