I'm trying to use a recursive function Power in Racket that takes as input two numbers x and y and returns xy, where x and y can be positive or negative.
;a power b
(printf "Enter value of X: ")
(define a (read))
(printf "Enter value of n: ")
(define b(read))
(define (power a b) (if (= b 0) 1 (* a (power a (- b 1 )))))
(define (DisplayResult a messg b mess res) (display a) (display messg)(display b) (display mess) (display res))
(DisplayResult a " power " b " is " (power a b))
How can the program accept negative power?