RosettaCodeData/Task/Zero-to-the-zero-power/Racket/zero-to-the-zero-power.rkt
2023-07-01 13:44:08 -04:00

14 lines
466 B
Racket

#lang racket
;; as many zeros as I can think of...
(define zeros (list
0 ; unspecified number type
0. ; hinted as float
#e0 ; explicitly exact
#i0 ; explicitly inexact
0+0i ; exact complex
0.+0.i ; float inexact
))
(for*((z zeros) (p zeros))
(printf "(~a)^(~a) = ~s~%" z p
(with-handlers [(exn:fail:contract:divide-by-zero? exn-message)]
(expt z p))))