class decimal.FloatOperation
Enable stricter semantics for mixing floats and Decimals.
If the signal is not trapped (default), mixing floats and Decimals is permitted in the Decimal
constructor, create_decimal()
and all comparison operators. Both conversion and comparisons are exact. Any occurrence of a mixed operation is silently recorded by setting FloatOperation
in the context flags. Explicit conversions with from_float()
or create_decimal_from_float()
do not set the flag.
Otherwise (the signal is trapped), only equality comparisons and explicit conversions are silent. All other mixed operations raise FloatOperation
.
Please login to continue.