In: Computer Science
How to create a divide function in (Dr Racket) programming language without using the built in function " / " ?
Greetings!!!!!!!
Please find the required division function in DrRacket with few sample run screen shots.
(define (division numerator denominator)
(let divide ([changnum numerator]
[changdeno denominator]
[incQuot 0]
[signIndicator 1])
(cond
[(< changnum 0)
(divide (- changnum) changdeno incQuot (- signIndicator))]
[(< changdeno 0)
(divide changnum (- changdeno) incQuot (- signIndicator))]
[(< changnum changdeno)
(* signIndicator incQuot)]
[else
(divide (- changnum changdeno) changdeno (+ incQuot 1) signIndicator)])))
Thank You