mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Merge pull request #3175 from lijm1358/cmath-atan-atanh
Add `atanh` and `atan` to `cmath`
This commit is contained in:
2 files changed
+14
-2
No files matched your search
Vendored
+2
-2
@@ -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