Modul Numerik dan Matematika¶
Modul-modul yang diuraikan dalam bab ini menyediakan fungsi-fungsi dan tipe data yang berkaitan dengan angka dan matematika. Modul numbers
mendefinisikan hirarki abstrak tipe numerik. Modul math
dan cmath
berisi berbagai fungsi matematika untuk angka-angka pecahan floating-point dan kompleks. Modul decimal
mendukung representasi tepat angka desimal, menggunakan presisi aritmatika yang berubah-ubah arbitrary.
Modul-modul berikut didokumentasikan dalam bab ini:
numbers
--- Numeric abstract base classesmath
--- Mathematical functionscmath
--- Mathematical functions for complex numbersdecimal
--- Decimal fixed-point and floating-point arithmetic- Quick-start Tutorial
- Decimal objects
Decimal
adjusted()
as_integer_ratio()
as_tuple()
canonical()
compare()
compare_signal()
compare_total()
compare_total_mag()
conjugate()
copy_abs()
copy_negate()
copy_sign()
exp()
from_float()
fma()
is_canonical()
is_finite()
is_infinite()
is_nan()
is_normal()
is_qnan()
is_signed()
is_snan()
is_subnormal()
is_zero()
ln()
log10()
logb()
logical_and()
logical_invert()
logical_or()
logical_xor()
max()
max_mag()
min()
min_mag()
next_minus()
next_plus()
next_toward()
normalize()
number_class()
quantize()
radix()
remainder_near()
rotate()
same_quantum()
scaleb()
shift()
sqrt()
to_eng_string()
to_integral()
to_integral_exact()
to_integral_value()
- Logical operands
- Context objects
getcontext()
setcontext()
localcontext()
BasicContext
ExtendedContext
DefaultContext
Context
clear_flags()
clear_traps()
copy()
copy_decimal()
create_decimal()
create_decimal_from_float()
Etiny()
Etop()
abs()
add()
canonical()
compare()
compare_signal()
compare_total()
compare_total_mag()
copy_abs()
copy_negate()
copy_sign()
divide()
divide_int()
divmod()
exp()
fma()
is_canonical()
is_finite()
is_infinite()
is_nan()
is_normal()
is_qnan()
is_signed()
is_snan()
is_subnormal()
is_zero()
ln()
log10()
logb()
logical_and()
logical_invert()
logical_or()
logical_xor()
max()
max_mag()
min()
min_mag()
minus()
multiply()
next_minus()
next_plus()
next_toward()
normalize()
number_class()
plus()
power()
quantize()
radix()
remainder()
remainder_near()
rotate()
same_quantum()
scaleb()
shift()
sqrt()
subtract()
to_eng_string()
to_integral_exact()
to_sci_string()
- Konstanta
- Rounding modes
- Signals
- Floating-Point Notes
- Working with threads
- Recipes
- Decimal FAQ
fractions
--- Rational numbersrandom
--- Generate pseudo-random numbersstatistics
--- Mathematical statistics functions