@@ -3921,15 +3921,15 @@ _decimal.Decimal.to_integral_value
3921
3921
3922
3922
Round to the nearest integer without signaling Inexact or Rounded.
3923
3923
3924
- The rounding mode is determined by the rounding parameter if given, else by
3925
- the given context. If neither parameter is given, then the rounding mode of
3926
- the current default context is used.
3924
+ The rounding mode is determined by the rounding parameter if given,
3925
+ else by the given context. If neither parameter is given, then the
3926
+ rounding mode of the current default context is used.
3927
3927
[clinic start generated code]*/
3928
3928
3929
3929
static PyObject *
3930
3930
_decimal_Decimal_to_integral_value_impl (PyObject * dec , PyObject * rounding ,
3931
3931
PyObject * context )
3932
- /*[clinic end generated code: output=1517d948029dbecc input=0fd8dd3bc5248b21 ]*/
3932
+ /*[clinic end generated code: output=1517d948029dbecc input=0afac3e278bdb511 ]*/
3933
3933
{
3934
3934
PyObject * result ;
3935
3935
uint32_t status = 0 ;
@@ -3971,13 +3971,14 @@ _decimal.Decimal.to_integral
3971
3971
3972
3972
Identical to the to_integral_value() method.
3973
3973
3974
- The to_integral() name has been kept for compatibility with older versions.
3974
+ The to_integral() name has been kept for compatibility with older
3975
+ versions.
3975
3976
[clinic start generated code]*/
3976
3977
3977
3978
static PyObject *
3978
3979
_decimal_Decimal_to_integral_impl (PyObject * self , PyObject * rounding ,
3979
3980
PyObject * context )
3980
- /*[clinic end generated code: output=a0c7188686ee7f5c input=a57d62d1d29aed1b ]*/
3981
+ /*[clinic end generated code: output=a0c7188686ee7f5c input=8eac6def038d13b9 ]*/
3981
3982
{
3982
3983
return _decimal_Decimal_to_integral_value_impl (self , rounding , context );
3983
3984
}
@@ -3991,16 +3992,16 @@ _decimal.Decimal.to_integral_exact
3991
3992
3992
3993
Round to the nearest integer.
3993
3994
3994
- Decimal.to_integral_exact() signals Inexact or Rounded as appropriate if
3995
- rounding occurs. The rounding mode is determined by the rounding parameter
3996
- if given, else by the given context. If neither parameter is given, then the
3997
- rounding mode of the current default context is used.
3995
+ Decimal.to_integral_exact() signals Inexact or Rounded as appropriate
3996
+ if rounding occurs. The rounding mode is determined by the rounding
3997
+ parameter if given, else by the given context. If neither parameter is
3998
+ given, then the rounding mode of the current default context is used.
3998
3999
[clinic start generated code]*/
3999
4000
4000
4001
static PyObject *
4001
4002
_decimal_Decimal_to_integral_exact_impl (PyObject * dec , PyObject * rounding ,
4002
4003
PyObject * context )
4003
- /*[clinic end generated code: output=bfcd6d3ac47460d7 input=095a7cc7368dcfbb ]*/
4004
+ /*[clinic end generated code: output=bfcd6d3ac47460d7 input=8cb083bc2b4fb1c3 ]*/
4004
4005
{
4005
4006
PyObject * result ;
4006
4007
uint32_t status = 0 ;
@@ -4612,12 +4613,12 @@ Dec_BoolFuncVA(mpd_issubnormal)
4612
4613
/*[clinic input]
4613
4614
_decimal.Decimal.adjusted
4614
4615
4615
- Return the adjusted exponent of the number. Defined as exp + digits - 1.
4616
+ Return the adjusted exponent ( exp + digits - 1) of the number .
4616
4617
[clinic start generated code]*/
4617
4618
4618
4619
static PyObject *
4619
4620
_decimal_Decimal_adjusted_impl (PyObject * self )
4620
- /*[clinic end generated code: output=21ea2c9f23994c52 input=775a14d44f31f787 ]*/
4621
+ /*[clinic end generated code: output=21ea2c9f23994c52 input=8ba2029d8d906b18 ]*/
4621
4622
{
4622
4623
mpd_ssize_t retval ;
4623
4624
@@ -4636,13 +4637,13 @@ _decimal.Decimal.canonical
4636
4637
4637
4638
Return the canonical encoding of the argument.
4638
4639
4639
- Currently, the encoding of a Decimal instance is always canonical, so this
4640
- operation returns its argument unchanged.
4640
+ Currently, the encoding of a Decimal instance is always canonical,
4641
+ so this operation returns its argument unchanged.
4641
4642
[clinic start generated code]*/
4642
4643
4643
4644
static PyObject *
4644
4645
_decimal_Decimal_canonical_impl (PyObject * self )
4645
- /*[clinic end generated code: output=3cbeb47d91e6da2d input=9089f031f530238e ]*/
4646
+ /*[clinic end generated code: output=3cbeb47d91e6da2d input=8a4719d14c52d521 ]*/
4646
4647
{
4647
4648
return Py_NewRef (self );
4648
4649
}
@@ -4696,13 +4697,13 @@ _decimal.Decimal.copy_abs
4696
4697
4697
4698
Return the absolute value of the argument.
4698
4699
4699
- This operation is unaffected by context and is quiet: no flags are changed and
4700
- no rounding is performed.
4700
+ This operation is unaffected by context and is quiet: no flags are
4701
+ changed and no rounding is performed.
4701
4702
[clinic start generated code]*/
4702
4703
4703
4704
static PyObject *
4704
4705
_decimal_Decimal_copy_abs_impl (PyObject * self )
4705
- /*[clinic end generated code: output=fff53742cca94d70 input=fa96ebbfd9191e72 ]*/
4706
+ /*[clinic end generated code: output=fff53742cca94d70 input=a263c2e71d421f1b ]*/
4706
4707
{
4707
4708
PyObject * result ;
4708
4709
uint32_t status = 0 ;
@@ -4727,13 +4728,13 @@ _decimal.Decimal.copy_negate
4727
4728
4728
4729
Return the negation of the argument.
4729
4730
4730
- This operation is unaffected by context and is quiet: no flags are changed and
4731
- no rounding is performed.
4731
+ This operation is unaffected by context and is quiet: no flags are
4732
+ changed and no rounding is performed.
4732
4733
[clinic start generated code]*/
4733
4734
4734
4735
static PyObject *
4735
4736
_decimal_Decimal_copy_negate_impl (PyObject * self )
4736
- /*[clinic end generated code: output=8551bc26dbc5d01d input=2ca2ce000154fca0 ]*/
4737
+ /*[clinic end generated code: output=8551bc26dbc5d01d input=13d47ed3a5d228b1 ]*/
4737
4738
{
4738
4739
PyObject * result ;
4739
4740
uint32_t status = 0 ;
@@ -4767,20 +4768,24 @@ Return a string describing the class of the operand.
4767
4768
The returned value is one of the following ten strings:
4768
4769
4769
4770
* '-Infinity', indicating that the operand is negative infinity.
4770
- * '-Normal', indicating that the operand is a negative normal number.
4771
- * '-Subnormal', indicating that the operand is negative and subnormal.
4771
+ * '-Normal', indicating that the operand is a negative normal
4772
+ number.
4773
+ * '-Subnormal', indicating that the operand is negative and
4774
+ subnormal.
4772
4775
* '-Zero', indicating that the operand is a negative zero.
4773
4776
* '+Zero', indicating that the operand is a positive zero.
4774
- * '+Subnormal', indicating that the operand is positive and subnormal.
4775
- * '+Normal', indicating that the operand is a positive normal number.
4777
+ * '+Subnormal', indicating that the operand is positive and
4778
+ subnormal.
4779
+ * '+Normal', indicating that the operand is a positive normal
4780
+ number.
4776
4781
* '+Infinity', indicating that the operand is positive infinity.
4777
4782
* 'NaN', indicating that the operand is a quiet NaN (Not a Number).
4778
4783
* 'sNaN', indicating that the operand is a signaling NaN.
4779
4784
[clinic start generated code]*/
4780
4785
4781
4786
static PyObject *
4782
4787
_decimal_Decimal_number_class_impl (PyObject * self , PyObject * context )
4783
- /*[clinic end generated code: output=3044cd45966b4949 input=80cc37edb4fd663f ]*/
4788
+ /*[clinic end generated code: output=3044cd45966b4949 input=f3d6cdda603e8b89 ]*/
4784
4789
{
4785
4790
const char * cp ;
4786
4791
@@ -4798,17 +4803,18 @@ _decimal.Decimal.to_eng_string
4798
4803
4799
4804
Convert to an engineering-type string.
4800
4805
4801
- Engineering notation has an exponent which is a multiple of 3, so there are up
4802
- to 3 digits left of the decimal place. For example, Decimal('123E+1') is
4803
- converted to Decimal('1.23E+3').
4806
+ Engineering notation has an exponent which is a multiple of 3, so there
4807
+ are up to 3 digits left of the decimal place. For example,
4808
+ Decimal('123E+1') is converted to Decimal('1.23E+3').
4804
4809
4805
- The value of context.capitals determines whether the exponent sign is lower
4806
- or upper case. Otherwise, the context does not affect the operation.
4810
+ The value of context.capitals determines whether the exponent sign is
4811
+ lower or upper case. Otherwise, the context does not affect the
4812
+ operation.
4807
4813
[clinic start generated code]*/
4808
4814
4809
4815
static PyObject *
4810
4816
_decimal_Decimal_to_eng_string_impl (PyObject * self , PyObject * context )
4811
- /*[clinic end generated code: output=d386194c25ffffa7 input=36436cb7973dd5d0 ]*/
4817
+ /*[clinic end generated code: output=d386194c25ffffa7 input=2e13e7c7c1bad2ad ]*/
4812
4818
{
4813
4819
PyObject * result ;
4814
4820
mpd_ssize_t size ;
@@ -4839,22 +4845,23 @@ _decimal.Decimal.copy_sign
4839
4845
other: object
4840
4846
context: object = None
4841
4847
4842
- Return a copy of *self* with the sign set to be the same as the sign of *other*.
4848
+ Return a copy of *self* with the sign of *other*.
4843
4849
4844
4850
For example:
4845
4851
4846
4852
>>> Decimal('2.3').copy_sign(Decimal('-1.5'))
4847
4853
Decimal('-2.3')
4848
4854
4849
- This operation is unaffected by context and is quiet: no flags are changed
4850
- and no rounding is performed. As an exception, the C version may raise
4851
- InvalidOperation if the second operand cannot be converted exactly.
4855
+ This operation is unaffected by context and is quiet: no flags are
4856
+ changed and no rounding is performed. As an exception, the C version
4857
+ may raise InvalidOperation if the second operand cannot be converted
4858
+ exactly.
4852
4859
[clinic start generated code]*/
4853
4860
4854
4861
static PyObject *
4855
4862
_decimal_Decimal_copy_sign_impl (PyObject * self , PyObject * other ,
4856
4863
PyObject * context )
4857
- /*[clinic end generated code: output=72c62177763e012e input=96b620d142ed80a9 ]*/
4864
+ /*[clinic end generated code: output=72c62177763e012e input=8410238d533a06eb ]*/
4858
4865
{
4859
4866
PyObject * a , * b ;
4860
4867
PyObject * result ;
@@ -4888,17 +4895,18 @@ _decimal.Decimal.same_quantum
4888
4895
other: object
4889
4896
context: object = None
4890
4897
4891
- Test whether self and other have the same exponent or whether both are NaN.
4898
+ Test whether self and other have the same exponent or both are NaN.
4892
4899
4893
- This operation is unaffected by context and is quiet: no flags are changed
4894
- and no rounding is performed. As an exception, the C version may raise
4895
- InvalidOperation if the second operand cannot be converted exactly.
4900
+ This operation is unaffected by context and is quiet: no flags are
4901
+ changed and no rounding is performed. As an exception, the C version
4902
+ may raise InvalidOperation if the second operand cannot be converted
4903
+ exactly.
4896
4904
[clinic start generated code]*/
4897
4905
4898
4906
static PyObject *
4899
4907
_decimal_Decimal_same_quantum_impl (PyObject * self , PyObject * other ,
4900
4908
PyObject * context )
4901
- /*[clinic end generated code: output=c0a3a046c662a7e2 input=d583092dec58453e ]*/
4909
+ /*[clinic end generated code: output=c0a3a046c662a7e2 input=3ae45df81d6edb73 ]*/
4902
4910
{
4903
4911
PyObject * a , * b ;
4904
4912
PyObject * result ;
@@ -4931,29 +4939,34 @@ _decimal.Decimal.quantize
4931
4939
rounding: object = None
4932
4940
context: object = None
4933
4941
4934
- Return a value equal to *self* after rounding, with the exponent of *other*.
4942
+ Quantize *self* so its exponent is the same as that of *exp*.
4943
+
4944
+ Return a value equal to *self* after rounding, with the exponent
4945
+ of *exp*.
4935
4946
4936
4947
>>> Decimal('1.41421356').quantize(Decimal('1.000'))
4937
4948
Decimal('1.414')
4938
4949
4939
- Unlike other operations, if the length of the coefficient after the quantize
4940
- operation would be greater than precision, then an InvalidOperation is signaled.
4941
- This guarantees that, unless there is an error condition, the quantized exponent
4942
- is always equal to that of the right-hand operand.
4950
+ Unlike other operations, if the length of the coefficient after the
4951
+ quantize operation would be greater than precision, then an
4952
+ InvalidOperation is signaled. This guarantees that, unless there
4953
+ is an error condition, the quantized exponent is always equal to
4954
+ that of the right-hand operand.
4943
4955
4944
- Also unlike other operations, quantize never signals Underflow, even if the
4945
- result is subnormal and inexact.
4956
+ Also unlike other operations, quantize never signals Underflow, even
4957
+ if the result is subnormal and inexact.
4946
4958
4947
- If the exponent of the second operand is larger than that of the first, then
4948
- rounding may be necessary. In this case, the rounding mode is determined by the
4949
- rounding argument if given, else by the given context argument; if neither
4950
- argument is given, the rounding mode of the current thread's context is used.
4959
+ If the exponent of the second operand is larger than that of the first,
4960
+ then rounding may be necessary. In this case, the rounding mode is
4961
+ determined by the rounding argument if given, else by the given context
4962
+ argument; if neither argument is given, the rounding mode of the
4963
+ current thread's context is used.
4951
4964
[clinic start generated code]*/
4952
4965
4953
4966
static PyObject *
4954
4967
_decimal_Decimal_quantize_impl (PyObject * v , PyObject * w , PyObject * rounding ,
4955
4968
PyObject * context )
4956
- /*[clinic end generated code: output=6ebc907ee3000c1f input=223b9dd92655b4bd ]*/
4969
+ /*[clinic end generated code: output=6ebc907ee3000c1f input=d1dc20057afe0c7e ]*/
4957
4970
{
4958
4971
PyObject * a , * b ;
4959
4972
PyObject * result ;
0 commit comments