File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -260,8 +260,6 @@ def testAcos(self):
260
260
self .assertRaises (ValueError , math .acos , - 1 - eps )
261
261
self .assertTrue (math .isnan (math .acos (NAN )))
262
262
263
- # TODO: RUSTPYTHON
264
- @unittest .expectedFailure
265
263
def testAcosh (self ):
266
264
self .assertRaises (TypeError , math .acosh )
267
265
self .ftest ('acosh(1)' , math .acosh (1 ), 0 )
Original file line number Diff line number Diff line change @@ -225,7 +225,15 @@ fn math_radians(x: IntoPyFloat) -> f64 {
225
225
}
226
226
227
227
// Hyperbolic functions:
228
- make_math_func ! ( math_acosh, acosh) ;
228
+ fn math_acosh ( x : IntoPyFloat , vm : & VirtualMachine ) -> PyResult < f64 > {
229
+ let x = x. to_f64 ( ) ;
230
+ if x. is_sign_negative ( ) || x. is_zero ( ) {
231
+ Err ( vm. new_value_error ( "math domain error" . to_owned ( ) ) )
232
+ } else {
233
+ Ok ( x. acosh ( ) )
234
+ }
235
+ }
236
+
229
237
make_math_func ! ( math_asinh, asinh) ;
230
238
make_math_func ! ( math_atanh, atanh) ;
231
239
make_math_func ! ( math_cosh, cosh) ;
You can’t perform that action at this time.
0 commit comments