Python‎ > ‎decimal‎ > ‎

Decimal.fma()

http://www.adilwaseem.com/

Definition
Fused multiply-add. Return x*y+z with no rounding of the intermediate product x*y.

Syntax
Decimal(x).fma(y,z)->Fused decimal value

Parameters
x,y,z=Decimal value

Examples
The return are:
 >>> Decimal(2.0).fma(3,7)
Decimal('13')
>>> Decimal(2.0).fma(7,3)
Decimal('17')
>>> Decimal(0).fma(3,7)
Decimal('7')
>>>

if min(map(lambda(decimal,decimal)).__gt__()
The method returns with the minimum value in the sets equation set1/set2*set2 is greater than 2. 
from decimal import*
set1={Decimal(-1355).adjusted(),Decimal(-233.321).copy_negate(), Decimal(-23.99).exp()}
set2={ Decimal(2.0).fma(3,7),Decimal(1.1).log10()}
if min(map(lambda a,b: a/b*b, set1, set2)).__gt__(2):
        print("Return is greater than 2.")
else:
        print("Not within parameters")

>>> 
Return is greater than 2.
>>>       



Comments