@@ -2899,12 +2899,11 @@ Decimal.from_float(0.1) is not the same as Decimal('0.1').
2899
2899
Decimal('Infinity')
2900
2900
>>> Decimal.from_float(float('-inf'))
2901
2901
Decimal('-Infinity')
2902
-
2903
2902
[clinic start generated code]*/
2904
2903
2905
2904
static PyObject *
2906
2905
_decimal_Decimal_from_float_impl (PyTypeObject * type , PyObject * pyfloat )
2907
- /*[clinic end generated code: output=e62775271ac469e6 input=31302a9a4c1d9c99 ]*/
2906
+ /*[clinic end generated code: output=e62775271ac469e6 input=052036648342f8c8 ]*/
2908
2907
{
2909
2908
PyObject * context ;
2910
2909
PyObject * result ;
@@ -3807,15 +3806,15 @@ dec_as_long(PyObject *dec, PyObject *context, int round)
3807
3806
/*[clinic input]
3808
3807
_decimal.Decimal.as_integer_ratio
3809
3808
3810
- Return a pair of integers, whose ratio is exactly equal to the original.
3809
+ Return a pair of integers whose ratio is exactly equal to the original.
3811
3810
3812
- The ratio is in lowest terms and with a positive denominator. Raise
3813
- OverflowError on infinities and a ValueError on NaNs.
3811
+ The ratio is in lowest terms and with a positive denominator.
3812
+ Raise OverflowError on infinities and a ValueError on NaNs.
3814
3813
[clinic start generated code]*/
3815
3814
3816
3815
static PyObject *
3817
3816
_decimal_Decimal_as_integer_ratio_impl (PyObject * self )
3818
- /*[clinic end generated code: output=c5d88e900080c264 input=3a4819b9484919d5 ]*/
3817
+ /*[clinic end generated code: output=c5d88e900080c264 input=7861cb643f01525a ]*/
3819
3818
{
3820
3819
PyObject * numerator = NULL ;
3821
3820
PyObject * denominator = NULL ;
@@ -3971,9 +3970,9 @@ _decimal.Decimal.to_integral_exact
3971
3970
rounding: object = None
3972
3971
context: object = None
3973
3972
3974
- Rounds to a nearby integer.
3973
+ Round to the nearest integer.
3975
3974
3976
- Round to the nearest integer, signaling Inexact or Rounded as appropriate if
3975
+ Decimal.to_integral_exact() signals Inexact or Rounded as appropriate if
3977
3976
rounding occurs. The rounding mode is determined by the rounding parameter
3978
3977
if given, else by the given context. If neither parameter is given, then the
3979
3978
rounding mode of the current default context is used.
@@ -3982,7 +3981,7 @@ rounding mode of the current default context is used.
3982
3981
static PyObject *
3983
3982
_decimal_Decimal_to_integral_exact_impl (PyObject * self , PyObject * rounding ,
3984
3983
PyObject * context )
3985
- /*[clinic end generated code: output=8b004f9b45ac7746 input=e98e6aabbc97a92c ]*/
3984
+ /*[clinic end generated code: output=8b004f9b45ac7746 input=edd30a9f06aed70b ]*/
3986
3985
{
3987
3986
PyObject * result ;
3988
3987
uint32_t status = 0 ;
@@ -4661,13 +4660,13 @@ _decimal.Decimal.radix
4661
4660
4662
4661
Return Decimal(10).
4663
4662
4664
- I.e. return the radix (base) in which the Decimal class does
4663
+ This is the radix (base) in which the Decimal class does
4665
4664
all its arithmetic. Included for compatibility with the specification.
4666
4665
[clinic start generated code]*/
4667
4666
4668
4667
static PyObject *
4669
4668
_decimal_Decimal_radix_impl (PyObject * self )
4670
- /*[clinic end generated code: output=6b1db4c3fcdb5ee1 input=c25ca314723040ed ]*/
4669
+ /*[clinic end generated code: output=6b1db4c3fcdb5ee1 input=18b72393549ca8fd ]*/
4671
4670
{
4672
4671
decimal_state * state = get_module_state_by_def (Py_TYPE (self ));
4673
4672
return _dec_mpd_radix (state );
@@ -4784,14 +4783,13 @@ Engineering notation has an exponent which is a multiple of 3, so there are up
4784
4783
to 3 digits left of the decimal place. For example, Decimal('123E+1') is
4785
4784
converted to Decimal('1.23E+3').
4786
4785
4787
- The value of context.capitals determines whether the exponent sign is lower or
4788
- upper case. Otherwise, the context does not affect the operation.
4789
-
4786
+ The value of context.capitals determines whether the exponent sign is lower
4787
+ or upper case. Otherwise, the context does not affect the operation.
4790
4788
[clinic start generated code]*/
4791
4789
4792
4790
static PyObject *
4793
4791
_decimal_Decimal_to_eng_string_impl (PyObject * self , PyObject * context )
4794
- /*[clinic end generated code: output=d386194c25ffffa7 input=fac5029cbf436bd5 ]*/
4792
+ /*[clinic end generated code: output=d386194c25ffffa7 input=36436cb7973dd5d0 ]*/
4795
4793
{
4796
4794
PyObject * result ;
4797
4795
mpd_ssize_t size ;
@@ -4822,22 +4820,22 @@ _decimal.Decimal.copy_sign
4822
4820
other: object
4823
4821
context: object = None
4824
4822
4825
- Returns self with the sign of other.
4823
+ Return a copy of * self* with the sign set to be the same as the sign of * other* .
4826
4824
4827
4825
For example:
4828
4826
4829
4827
>>> Decimal('2.3').copy_sign(Decimal('-1.5'))
4830
4828
Decimal('-2.3')
4831
4829
4832
4830
This operation is unaffected by context and is quiet: no flags are changed
4833
- and no rounding is performed. As an exception, the C version may raise
4831
+ and no rounding is performed. As an exception, the C version may raise
4834
4832
InvalidOperation if the second operand cannot be converted exactly.
4835
4833
[clinic start generated code]*/
4836
4834
4837
4835
static PyObject *
4838
4836
_decimal_Decimal_copy_sign_impl (PyObject * self , PyObject * other ,
4839
4837
PyObject * context )
4840
- /*[clinic end generated code: output=72c62177763e012e input=f02ebb5d7489c502 ]*/
4838
+ /*[clinic end generated code: output=72c62177763e012e input=96b620d142ed80a9 ]*/
4841
4839
{
4842
4840
PyObject * a , * b ;
4843
4841
PyObject * result ;
@@ -4873,15 +4871,15 @@ _decimal.Decimal.same_quantum
4873
4871
4874
4872
Test whether self and other have the same exponent or whether both are NaN.
4875
4873
4876
- This operation is unaffected by context and is quiet: no flags are changed and
4877
- no rounding is performed. As an exception, the C version may raise
4874
+ This operation is unaffected by context and is quiet: no flags are changed
4875
+ and no rounding is performed. As an exception, the C version may raise
4878
4876
InvalidOperation if the second operand cannot be converted exactly.
4879
4877
[clinic start generated code]*/
4880
4878
4881
4879
static PyObject *
4882
4880
_decimal_Decimal_same_quantum_impl (PyObject * self , PyObject * other ,
4883
4881
PyObject * context )
4884
- /*[clinic end generated code: output=c0a3a046c662a7e2 input=0930e11241231ac2 ]*/
4882
+ /*[clinic end generated code: output=c0a3a046c662a7e2 input=d583092dec58453e ]*/
4885
4883
{
4886
4884
PyObject * a , * b ;
4887
4885
PyObject * result ;
@@ -4913,10 +4911,7 @@ _decimal.Decimal.quantize
4913
4911
rounding: object = None
4914
4912
context: object = None
4915
4913
4916
- Quantize self so its exponent is the same as that of exp.
4917
-
4918
- Return a value equal to the first operand after rounding and having the
4919
- exponent of the second operand.
4914
+ Return a value equal to *self* after rounding, with the exponent of *other*.
4920
4915
4921
4916
>>> Decimal('1.41421356').quantize(Decimal('1.000'))
4922
4917
Decimal('1.414')
@@ -4938,7 +4933,7 @@ argument is given, the rounding mode of the current thread's context is used.
4938
4933
static PyObject *
4939
4934
_decimal_Decimal_quantize_impl (PyObject * self , PyObject * w ,
4940
4935
PyObject * rounding , PyObject * context )
4941
- /*[clinic end generated code: output=5e84581f96dc685c input=eed2fdd8d65fce21 ]*/
4936
+ /*[clinic end generated code: output=5e84581f96dc685c input=2053ebf488a665dc ]*/
4942
4937
{
4943
4938
PyObject * a , * b ;
4944
4939
PyObject * result ;
0 commit comments