forked from Rust-related/RustPython
Merge pull request #3175 from lijm1358/cmath-atan-atanh
Add `atanh` and `atan` to `cmath`
This commit is contained in:
4
Lib/test/test_cmath.py
vendored
4
Lib/test/test_cmath.py
vendored
@@ -56,9 +56,9 @@ class CMathTests(unittest.TestCase):
|
||||
#
|
||||
# list of all functions in cmath
|
||||
test_functions = [getattr(cmath, fname) for fname in [
|
||||
'sin','cos','log','log10','sqrt','acosh','tan','tanh','asinh'
|
||||
'sin','cos','log','log10','sqrt','acosh','tan','tanh','asinh', 'atan', 'atanh'
|
||||
# 'exp','acos','asin',
|
||||
# 'atan','atanh','sinh','cosh'
|
||||
# 'sinh','cosh'
|
||||
]]
|
||||
# test first and second arguments independently for 2-argument log
|
||||
# test_functions.append(lambda x : cmath.log(x, 1729. + 0j))
|
||||
|
||||
@@ -108,6 +108,18 @@ mod cmath {
|
||||
z.to_complex().acosh()
|
||||
}
|
||||
|
||||
/// Return the inverse tangent of z.
|
||||
#[pyfunction]
|
||||
fn atan(z: IntoPyComplex) -> Complex64 {
|
||||
z.to_complex().atan()
|
||||
}
|
||||
|
||||
/// Return the inverse hyperbolic tangent of z.
|
||||
#[pyfunction]
|
||||
fn atanh(z: IntoPyComplex) -> Complex64 {
|
||||
z.to_complex().atanh()
|
||||
}
|
||||
|
||||
/// Return the tangent of z.
|
||||
#[pyfunction]
|
||||
fn tan(z: IntoPyComplex) -> Complex64 {
|
||||
|
||||
Reference in New Issue
Block a user