[Git][cmucl/cmucl][issue-471-test-cases-for-pow] Adjust pow.case.9 for core-math
Raymond Toy pushed to branch issue-471-test-cases-for-pow at cmucl / cmucl Commits: 6011e629 by Raymond Toy at 2026-02-06T17:25:39-08:00 Adjust pow.case.9 for core-math Looks like cr_pow does what std::pow says for 1^exp for any exp and (-1)^(+/-inf) is 1. No errors signaled. Update the test for core-math. - - - - - 1 changed file: - tests/fdlibm.lisp Changes: ===================================== tests/fdlibm.lisp ===================================== @@ -785,10 +785,27 @@ (define-test %pow.case.9 (:tag :fdlibm) + ;; std::pow says 1^exp is 1 for any exp, including NaN. (-1)^(+/-inf) + ;; is 1. No errors signaled. + #+core-math + (progn + (assert-equal 1d0 + (kernel:%pow 1d0 ext:double-float-positive-infinity)) + (assert-equal 1d0 + (kernel:%pow 1d0 ext:double-float-negative-infinity)) + (assert-equal 1d0 + (kernel:%pow 1d0 *qnan*)) + (assert-equal 1d0 + (kernel:%pow -1d0 ext:double-float-positive-infinity)) + (assert-equal 1d0 + (kernel:%pow -1d0 ext:double-float-negative-infinity))) + #-core-math ;; +-1 ^ +-inf is NaN. ;; ;; But the implementation signals invalid operation, so we need to ;; check for that. + ;; + (progn (assert-error 'floating-point-invalid-operation (kernel:%pow 1d0 ext:double-float-positive-infinity)) (assert-error 'floating-point-invalid-operation @@ -805,7 +822,7 @@ (assert-true (ext:float-nan-p (kernel:%pow -1d0 ext:double-float-positive-infinity))) (assert-true (ext:float-nan-p - (kernel:%pow -1d0 ext:double-float-negative-infinity))))) + (kernel:%pow -1d0 ext:double-float-negative-infinity)))))) (define-test %pow.case.10 (:tag :fdlibm) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6011e6296a16d7d7ca253cea... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/6011e6296a16d7d7ca253cea... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)