Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-advanced-reader.ss" "lang")((modname |33.2|) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp")))))
4 ;infinite-n? : N -> N
5 ;Searches for a value from [n,inf) such that n is the largest natural number where (expt #i10. n) is still an inexact number rather than infinity.
7 (define (infinite-n? n)
8 (cond
9 [(< (expt #i10 (+ n 1)) +inf.0) (infinite-n? (add1 n))]
10 [else n]))