2 – (-12/x) = -4
the negative 12 is what is confusing me. where do I put the negative sign?
(define (math x)
( = ( - ( / 12 x) 2) 4))
The negative symbol is a part of the number itself, you write it like you would in any other language:
(define (math x)
( = ( - ( / -12 x) 2) 4))
Output:
> (math 2) ; 2-(-12/2) = -4 -> 2-(-6) = -4 -> 2 + 6 = -4 -> 8 = -4 (FALSE)
#f
> (math -2) ; 2-(-12/-2) = -4 -> 2-(6) = -4 -> -4 = -4 (TRUE)
#t
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With