Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (exact->stream q)
- (let
- ((first-decimal (lambda (x)
- (truncate (* x 10))
- )
- )
- )
- (let*
- ((inexact (exact->inexact q))
- (g (- inexact (truncate inexact)))
- (first (first-decimal g)))
- (if (= first 0)
- '()
- (cons-stream (inexact->exact first) (exact->stream (* g 10)))
- )
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement