@@ -573,7 +573,7 @@ Decimal objects
573
573
>>> Decimal(321 ).exp()
574
574
Decimal('2.561702493119680037517373933E+139')
575
575
576
- .. classmethod :: from_float(f)
576
+ .. classmethod :: from_float(f, / )
577
577
578
578
Alternative constructor that only accepts instances of :class: `float ` or
579
579
:class: `int `.
@@ -974,7 +974,7 @@ Each thread has its own current context which is accessed or changed using the
974
974
Return the current context for the active thread.
975
975
976
976
977
- .. function :: setcontext(c)
977
+ .. function :: setcontext(c, / )
978
978
979
979
Set the current context for the active thread to *c *.
980
980
@@ -1143,11 +1143,11 @@ In addition to the three supplied contexts, new contexts can be created with the
1143
1143
1144
1144
Return a duplicate of the context.
1145
1145
1146
- .. method :: copy_decimal(num)
1146
+ .. method :: copy_decimal(num, / )
1147
1147
1148
1148
Return a copy of the Decimal instance num.
1149
1149
1150
- .. method :: create_decimal(num)
1150
+ .. method :: create_decimal(num='0', / )
1151
1151
1152
1152
Creates a new Decimal instance from *num * but using *self * as
1153
1153
context. Unlike the :class: `Decimal ` constructor, the context precision,
@@ -1171,7 +1171,7 @@ In addition to the three supplied contexts, new contexts can be created with the
1171
1171
If the argument is a string, no leading or trailing whitespace or
1172
1172
underscores are permitted.
1173
1173
1174
- .. method :: create_decimal_from_float(f)
1174
+ .. method :: create_decimal_from_float(f, / )
1175
1175
1176
1176
Creates a new Decimal instance from a float *f * but rounding using *self *
1177
1177
as the context. Unlike the :meth: `Decimal.from_float ` class method,
@@ -1209,222 +1209,222 @@ In addition to the three supplied contexts, new contexts can be created with the
1209
1209
recounted here.
1210
1210
1211
1211
1212
- .. method :: abs(x)
1212
+ .. method :: abs(x, / )
1213
1213
1214
1214
Returns the absolute value of *x *.
1215
1215
1216
1216
1217
- .. method :: add(x, y)
1217
+ .. method :: add(x, y, / )
1218
1218
1219
1219
Return the sum of *x * and *y *.
1220
1220
1221
1221
1222
- .. method :: canonical(x)
1222
+ .. method :: canonical(x, / )
1223
1223
1224
1224
Returns the same Decimal object *x *.
1225
1225
1226
1226
1227
- .. method :: compare(x, y)
1227
+ .. method :: compare(x, y, / )
1228
1228
1229
1229
Compares *x * and *y * numerically.
1230
1230
1231
1231
1232
- .. method :: compare_signal(x, y)
1232
+ .. method :: compare_signal(x, y, / )
1233
1233
1234
1234
Compares the values of the two operands numerically.
1235
1235
1236
1236
1237
- .. method :: compare_total(x, y)
1237
+ .. method :: compare_total(x, y, / )
1238
1238
1239
1239
Compares two operands using their abstract representation.
1240
1240
1241
1241
1242
- .. method :: compare_total_mag(x, y)
1242
+ .. method :: compare_total_mag(x, y, / )
1243
1243
1244
1244
Compares two operands using their abstract representation, ignoring sign.
1245
1245
1246
1246
1247
- .. method :: copy_abs(x)
1247
+ .. method :: copy_abs(x, / )
1248
1248
1249
1249
Returns a copy of *x * with the sign set to 0.
1250
1250
1251
1251
1252
- .. method :: copy_negate(x)
1252
+ .. method :: copy_negate(x, / )
1253
1253
1254
1254
Returns a copy of *x * with the sign inverted.
1255
1255
1256
1256
1257
- .. method :: copy_sign(x, y)
1257
+ .. method :: copy_sign(x, y, / )
1258
1258
1259
1259
Copies the sign from *y * to *x *.
1260
1260
1261
1261
1262
- .. method :: divide(x, y)
1262
+ .. method :: divide(x, y, / )
1263
1263
1264
1264
Return *x * divided by *y *.
1265
1265
1266
1266
1267
- .. method :: divide_int(x, y)
1267
+ .. method :: divide_int(x, y, / )
1268
1268
1269
1269
Return *x * divided by *y *, truncated to an integer.
1270
1270
1271
1271
1272
- .. method :: divmod(x, y)
1272
+ .. method :: divmod(x, y, / )
1273
1273
1274
1274
Divides two numbers and returns the integer part of the result.
1275
1275
1276
1276
1277
- .. method :: exp(x)
1277
+ .. method :: exp(x, / )
1278
1278
1279
1279
Returns ``e ** x ``.
1280
1280
1281
1281
1282
- .. method :: fma(x, y, z)
1282
+ .. method :: fma(x, y, z, / )
1283
1283
1284
1284
Returns *x * multiplied by *y *, plus *z *.
1285
1285
1286
1286
1287
- .. method :: is_canonical(x)
1287
+ .. method :: is_canonical(x, / )
1288
1288
1289
1289
Returns ``True `` if *x * is canonical; otherwise returns ``False ``.
1290
1290
1291
1291
1292
- .. method :: is_finite(x)
1292
+ .. method :: is_finite(x, / )
1293
1293
1294
1294
Returns ``True `` if *x * is finite; otherwise returns ``False ``.
1295
1295
1296
1296
1297
- .. method :: is_infinite(x)
1297
+ .. method :: is_infinite(x, / )
1298
1298
1299
1299
Returns ``True `` if *x * is infinite; otherwise returns ``False ``.
1300
1300
1301
1301
1302
- .. method :: is_nan(x)
1302
+ .. method :: is_nan(x, / )
1303
1303
1304
1304
Returns ``True `` if *x * is a qNaN or sNaN; otherwise returns ``False ``.
1305
1305
1306
1306
1307
- .. method :: is_normal(x)
1307
+ .. method :: is_normal(x, / )
1308
1308
1309
1309
Returns ``True `` if *x * is a normal number; otherwise returns ``False ``.
1310
1310
1311
1311
1312
- .. method :: is_qnan(x)
1312
+ .. method :: is_qnan(x, / )
1313
1313
1314
1314
Returns ``True `` if *x * is a quiet NaN; otherwise returns ``False ``.
1315
1315
1316
1316
1317
- .. method :: is_signed(x)
1317
+ .. method :: is_signed(x, / )
1318
1318
1319
1319
Returns ``True `` if *x * is negative; otherwise returns ``False ``.
1320
1320
1321
1321
1322
- .. method :: is_snan(x)
1322
+ .. method :: is_snan(x, / )
1323
1323
1324
1324
Returns ``True `` if *x * is a signaling NaN; otherwise returns ``False ``.
1325
1325
1326
1326
1327
- .. method :: is_subnormal(x)
1327
+ .. method :: is_subnormal(x, / )
1328
1328
1329
1329
Returns ``True `` if *x * is subnormal; otherwise returns ``False ``.
1330
1330
1331
1331
1332
- .. method :: is_zero(x)
1332
+ .. method :: is_zero(x, / )
1333
1333
1334
1334
Returns ``True `` if *x * is a zero; otherwise returns ``False ``.
1335
1335
1336
1336
1337
- .. method :: ln(x)
1337
+ .. method :: ln(x, / )
1338
1338
1339
1339
Returns the natural (base e) logarithm of *x *.
1340
1340
1341
1341
1342
- .. method :: log10(x)
1342
+ .. method :: log10(x, / )
1343
1343
1344
1344
Returns the base 10 logarithm of *x *.
1345
1345
1346
1346
1347
- .. method :: logb(x)
1347
+ .. method :: logb(x, / )
1348
1348
1349
1349
Returns the exponent of the magnitude of the operand's MSD.
1350
1350
1351
1351
1352
- .. method :: logical_and(x, y)
1352
+ .. method :: logical_and(x, y, / )
1353
1353
1354
1354
Applies the logical operation *and * between each operand's digits.
1355
1355
1356
1356
1357
- .. method :: logical_invert(x)
1357
+ .. method :: logical_invert(x, / )
1358
1358
1359
1359
Invert all the digits in *x *.
1360
1360
1361
1361
1362
- .. method :: logical_or(x, y)
1362
+ .. method :: logical_or(x, y, / )
1363
1363
1364
1364
Applies the logical operation *or * between each operand's digits.
1365
1365
1366
1366
1367
- .. method :: logical_xor(x, y)
1367
+ .. method :: logical_xor(x, y, / )
1368
1368
1369
1369
Applies the logical operation *xor * between each operand's digits.
1370
1370
1371
1371
1372
- .. method :: max(x, y)
1372
+ .. method :: max(x, y, / )
1373
1373
1374
1374
Compares two values numerically and returns the maximum.
1375
1375
1376
1376
1377
- .. method :: max_mag(x, y)
1377
+ .. method :: max_mag(x, y, / )
1378
1378
1379
1379
Compares the values numerically with their sign ignored.
1380
1380
1381
1381
1382
- .. method :: min(x, y)
1382
+ .. method :: min(x, y, / )
1383
1383
1384
1384
Compares two values numerically and returns the minimum.
1385
1385
1386
1386
1387
- .. method :: min_mag(x, y)
1387
+ .. method :: min_mag(x, y, / )
1388
1388
1389
1389
Compares the values numerically with their sign ignored.
1390
1390
1391
1391
1392
- .. method :: minus(x)
1392
+ .. method :: minus(x, / )
1393
1393
1394
1394
Minus corresponds to the unary prefix minus operator in Python.
1395
1395
1396
1396
1397
- .. method :: multiply(x, y)
1397
+ .. method :: multiply(x, y, / )
1398
1398
1399
1399
Return the product of *x * and *y *.
1400
1400
1401
1401
1402
- .. method :: next_minus(x)
1402
+ .. method :: next_minus(x, / )
1403
1403
1404
1404
Returns the largest representable number smaller than *x *.
1405
1405
1406
1406
1407
- .. method :: next_plus(x)
1407
+ .. method :: next_plus(x, / )
1408
1408
1409
1409
Returns the smallest representable number larger than *x *.
1410
1410
1411
1411
1412
- .. method :: next_toward(x, y)
1412
+ .. method :: next_toward(x, y, / )
1413
1413
1414
1414
Returns the number closest to *x *, in direction towards *y *.
1415
1415
1416
1416
1417
- .. method :: normalize(x)
1417
+ .. method :: normalize(x, / )
1418
1418
1419
1419
Reduces *x * to its simplest form.
1420
1420
1421
1421
1422
- .. method :: number_class(x)
1422
+ .. method :: number_class(x, / )
1423
1423
1424
1424
Returns an indication of the class of *x *.
1425
1425
1426
1426
1427
- .. method :: plus(x)
1427
+ .. method :: plus(x, / )
1428
1428
1429
1429
Plus corresponds to the unary prefix plus operator in Python. This
1430
1430
operation applies the context precision and rounding, so it is *not * an
@@ -1465,7 +1465,7 @@ In addition to the three supplied contexts, new contexts can be created with the
1465
1465
always exact.
1466
1466
1467
1467
1468
- .. method :: quantize(x, y)
1468
+ .. method :: quantize(x, y, / )
1469
1469
1470
1470
Returns a value equal to *x * (rounded), having the exponent of *y *.
1471
1471
@@ -1475,51 +1475,51 @@ In addition to the three supplied contexts, new contexts can be created with the
1475
1475
Just returns 10, as this is Decimal, :)
1476
1476
1477
1477
1478
- .. method :: remainder(x, y)
1478
+ .. method :: remainder(x, y, / )
1479
1479
1480
1480
Returns the remainder from integer division.
1481
1481
1482
1482
The sign of the result, if non-zero, is the same as that of the original
1483
1483
dividend.
1484
1484
1485
1485
1486
- .. method :: remainder_near(x, y)
1486
+ .. method :: remainder_near(x, y, / )
1487
1487
1488
1488
Returns ``x - y * n ``, where *n * is the integer nearest the exact value
1489
1489
of ``x / y `` (if the result is 0 then its sign will be the sign of *x *).
1490
1490
1491
1491
1492
- .. method :: rotate(x, y)
1492
+ .. method :: rotate(x, y, / )
1493
1493
1494
1494
Returns a rotated copy of *x *, *y * times.
1495
1495
1496
1496
1497
- .. method :: same_quantum(x, y)
1497
+ .. method :: same_quantum(x, y, / )
1498
1498
1499
1499
Returns ``True `` if the two operands have the same exponent.
1500
1500
1501
1501
1502
- .. method :: scaleb (x, y)
1502
+ .. method :: scaleb (x, y, / )
1503
1503
1504
1504
Returns the first operand after adding the second value its exp.
1505
1505
1506
1506
1507
- .. method :: shift(x, y)
1507
+ .. method :: shift(x, y, / )
1508
1508
1509
1509
Returns a shifted copy of *x *, *y * times.
1510
1510
1511
1511
1512
- .. method :: sqrt(x)
1512
+ .. method :: sqrt(x, / )
1513
1513
1514
1514
Square root of a non-negative number to context precision.
1515
1515
1516
1516
1517
- .. method :: subtract(x, y)
1517
+ .. method :: subtract(x, y, / )
1518
1518
1519
1519
Return the difference between *x * and *y *.
1520
1520
1521
1521
1522
- .. method :: to_eng_string(x)
1522
+ .. method :: to_eng_string(x, / )
1523
1523
1524
1524
Convert to a string, using engineering notation if an exponent is needed.
1525
1525
@@ -1528,12 +1528,12 @@ In addition to the three supplied contexts, new contexts can be created with the
1528
1528
require the addition of either one or two trailing zeros.
1529
1529
1530
1530
1531
- .. method :: to_integral_exact(x)
1531
+ .. method :: to_integral_exact(x, / )
1532
1532
1533
1533
Rounds to an integer.
1534
1534
1535
1535
1536
- .. method :: to_sci_string(x)
1536
+ .. method :: to_sci_string(x, / )
1537
1537
1538
1538
Converts a number to a string using scientific notation.
1539
1539
0 commit comments