Answer the question
In order to leave comments, you need to log in
How does the "if not" construct work in scheme (IEEE)?
sicp
Exercise 1.15
(define (cube x) (* x x x))
(define (p x) (- (* 3 x) (* 4 (cube x))))
(define (sine angle)
(if (not (> (abs angle) 0.1))
angle
(p (sine (/ angle 3.0)))))
(sine 12.15)
Answer the question
In order to leave comments, you need to log in
(if (<= (abs angle) 0.1)
The > function returns #t if its first operand is greater than its second. The not function returns #t if its operand is #f, and vice versa.
each time it gave an error when replacing "not"
I already thought that this was such a special construction
now it's clear I just forgot to remove the extra bracket and instead of
(if (<= (abs angle) 0.1) I
wrote
(if (<= (abs angle) 0.1) )
..... well
the issue is resolved
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question