Hàm thập phân trong Python. Hiệp 1
Cải thiện bài viết
Lưu bài viết
Thích bài viết
- Độ khó. Dễ dàng
- Cập nhật lần cuối. 22 tháng 1 năm 2022
Cải thiện bài viết
Lưu bài viết
Python theo định nghĩa của nó cung cấp một số phương thức nhất định để thực hiện phép tính số học dấu phẩy động thập phân nhanh hơn bằng cách sử dụng mô-đun “thập phân”.
Các phép toán quan trọng trên số thập phân
1. sqrt[]. - Hàm này tính căn bậc hai của số thập phân
2. kinh nghiệm[]. - Hàm này trả về e^x [số mũ] của số thập phân
Python3
# Python code to demonstrate the working of
# sqrt[] and exp[]
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691182
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691186
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691187
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691188
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691186
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 133
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 134
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 137
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138_______0_______4
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 132
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 133
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 136
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138_______0_______4
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -11
đầu ra.
The exponent of decimal number is : 90.01713130052181355011545675 The square root of decimal number is : 2.121320343559642573202533086
3. ln[]. - Hàm này dùng để tính logarit tự nhiên của số thập phân
4. log10[]. - Hàm này dùng để tính log [cơ số 10] của một số thập phân
Python3
# Python code to demonstrate the working of
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -13
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -17
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691186
The absolute value using copy_abs[] is : 9.5600000000000004973799150320701301097869873046875 The negated value using copy_negate[] is : 9.5600000000000004973799150320701301097869873046875 The sign effected value using copy_sign[] is : -9.52999999999999936051153781590983271598815917968752
The absolute value using copy_abs[] is : 9.5600000000000004973799150320701301097869873046875 The negated value using copy_negate[] is : 9.5600000000000004973799150320701301097869873046875 The sign effected value using copy_sign[] is : -9.52999999999999936051153781590983271598815917968753
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691186
The absolute value using copy_abs[] is : 9.5600000000000004973799150320701301097869873046875 The negated value using copy_negate[] is : 9.5600000000000004973799150320701301097869873046875 The sign effected value using copy_sign[] is : -9.52999999999999936051153781590983271598815917968758
The absolute value using copy_abs[] is : 9.5600000000000004973799150320701301097869873046875 The negated value using copy_negate[] is : 9.5600000000000004973799150320701301097869873046875 The sign effected value using copy_sign[] is : -9.52999999999999936051153781590983271598815917968759
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The minimum of two numbers is : 7.429999999999999715782905696 The maximum of two numbers is : 9.5299999999999993605115378162
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 132
The minimum of two numbers is : 7.429999999999999715782905696 The maximum of two numbers is : 9.5299999999999993605115378168
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
# Python code to demonstrate the working of
1decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -11
đầu ra.
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.6532125137753436793763169118
5. as_tuple[]. - Trả về số thập phân dưới dạng bộ chứa 3 đối số, dấu [0 cho +, 1 cho -], chữ số và giá trị số mũ
6. fma[a,b]. - “fma” này là viết tắt của fused multiple và add. Nó tính toán [num*a]+b từ các số trong đối số. Không làm tròn số [num*a] trong hàm này
Ví dụ.
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 13
Python3
# Python code to demonstrate the working of
# Python code to demonstrate the working of
8
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
# sqrt[] and exp[]
2
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
# sqrt[] and exp[]
6_______0_______6# sqrt[] and exp[]
8
# sqrt[] and exp[]
9
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
# importing "decimal" module to use decimal functions
3_______205_______4# importing "decimal" module to use decimal functions
5# importing "decimal" module to use decimal functions
6# importing "decimal" module to use decimal functions
7# importing "decimal" module to use decimal functions
8
# importing "decimal" module to use decimal functions
9
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911802
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138_______0_______4
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 132
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911808
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911811
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -11
đầu ra.
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 13
7. so sánh[]. - Hàm này dùng để so sánh các số thập phân. Trả về 1 nếu đối số thập phân thứ nhất lớn hơn đối số thứ 2, -1 nếu đối số thập phân thứ nhất nhỏ hơn đối số thứ 2 và 0 nếu cả hai bằng nhau
8. so_total_mag[]. - So sánh tổng độ lớn của các số thập phân. Trả về 1 nếu đối số thập phân thứ nhất lớn hơn đối số thứ 2 [bỏ qua dấu], -1 nếu đối số thập phân thứ nhất nhỏ hơn đối số thứ 2 [bỏ qua dấu] và 0 nếu cả hai bằng nhau [bỏ qua dấu]
Python3
# Python code to demonstrate the working of
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911818
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911826
# importing "decimal" module to use decimal functions
8
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
# sqrt[] and exp[]
6_______0_______33# importing "decimal" module to use decimal functions
8
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911835
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911838
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911843
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911844
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911847
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911852
đầu ra.
The result of comparison using compare[] is : 1 The result of comparison using compare_total_mag[] is : -1
9. copy_abs[]. - Hàm này in giá trị tuyệt đối của đối số thập phân
10. copy_negate[]. - Hàm này in phủ định của đối số thập phân
11. copy_sign[]. - Hàm này in đối số đầu tiên bằng cách sao chép dấu từ đối số thứ 2
Python3
# Python code to demonstrate the working of
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911854
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911826
# importing "decimal" module to use decimal functions
8
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
# sqrt[] and exp[]
6_______0_______33# importing "decimal" module to use decimal functions
8
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911871
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911874
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911879
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911880
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911883
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911888
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911889
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911892
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138_______0_______4
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911897
đầu ra.
The absolute value using copy_abs[] is : 9.5600000000000004973799150320701301097869873046875 The negated value using copy_negate[] is : 9.5600000000000004973799150320701301097869873046875 The sign effected value using copy_sign[] is : -9.5299999999999993605115378159098327159881591796875
12. tối đa[]. - Hàm này tính tổng hai số thập phân lớn nhất
13. phút[]. - Hàm này tính tổng nhỏ nhất của hai số thập phân
Python3
# Python code to demonstrate the working of
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911899
# importing "decimal" module to use decimal functions
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691180
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691181
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691183
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911826
# importing "decimal" module to use decimal functions
8
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.653212513775343679376316911822
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691189
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691185
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1313
# importing "decimal" module to use decimal functions
8
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1315
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1318
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1323
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1324
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1325
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1326
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 136
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1329
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 138
The natural logarithm of decimal number is : 1.504077396776274073373258352 The log[base 10] of decimal number is : 0.65321251377534367937631691184
The tuple form of decimal number is : DecimalTuple[sign=1, digits=[4, 5], exponent=-1] The fused multiply and addition of decimal number is : 130
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 135
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1323
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1335
decimal.Decimal[5].fma[2,3] --> [5*2]+3 = 1325
đầu ra.
The minimum of two numbers is : 7.429999999999999715782905696 The maximum of two numbers is : 9.529999999999999360511537816
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeeksforGeeks và muốn đóng góp, bạn cũng có thể viết một bài báo bằng cách sử dụng write. chuyên viên máy tính. org hoặc gửi bài viết của bạn tới review-team@geeksforgeeks. tổ chức. Xem bài viết của bạn xuất hiện trên trang chính của GeeksforGeeks và trợ giúp các Geeks khác
Vui lòng viết bình luận nếu bạn thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề thảo luận ở trên
Ghi chú cá nhân của tôi arrow_drop_up
Cứu