Skip to content

Instantly share code, notes, and snippets.

@ecounysis
Created December 28, 2011 07:24
Show Gist options
  • Save ecounysis/1526946 to your computer and use it in GitHub Desktop.
Save ecounysis/1526946 to your computer and use it in GitHub Desktop.
Exercise 2.5
(define (remove-factor x y)
(if (= 0 (modulo x y)) (remove-factor (/ x y) y) x))
(define (loga x y) (/ (log x) (log y)))
(define (consa a b) (* (expt 2 a) (expt 3 b)))
(define (cara p) (inexact->exact (loga (remove-factor p 3) 2)))
(define (cdra p) (inexact->exact (loga (remove-factor p 2) 3)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment