Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Classe « Decimal » Python 3.11.3

Méthode decimal.Decimal.copy_sign

Signature de la méthode copy_sign

def copy_sign(self, /, other, context=None) 

Description

help(Decimal.copy_sign)

Return a copy of the first operand with the sign set to be the same as the
sign of the second operand. For example:

    >>> Decimal('2.3').copy_sign(Decimal('-1.5'))
    Decimal('-2.3')

This operation is unaffected by context and is quiet: no flags are changed
and no rounding is performed. As an exception, the C version may raise
InvalidOperation if the second operand cannot be converted exactly.