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