diff --git a/info.rkt b/info.rkt index 837585f..156d702 100644 --- a/info.rkt +++ b/info.rkt @@ -3,6 +3,6 @@ (define deps '("base" "math-lib" "pict-lib")) (define build-deps '("rackunit-lib" "racket-doc" "scribble-lib" "scribble-doc" "rackunit-abbrevs")) (define pkg-desc "Utility functions") -(define version "0.1") +(define version "0.2") (define pkg-authors '(ben)) (define scribblings '(("scribblings/gtp-util.scrbl" ()))) diff --git a/main.rkt b/main.rkt index 7a2ef6c..d3401ac 100644 --- a/main.rkt +++ b/main.rkt @@ -52,9 +52,6 @@ [log2 (-> exact-nonnegative-integer? exact-nonnegative-integer?)] - [order-of-magnitude - (-> real? exact-nonnegative-integer?)] - [file-remove-extension (-> path-string? path-string?)] ;; Removes a Racket-added extension from a filename. @@ -260,12 +257,6 @@ [else (loop (+ k 1))]))])) -(define (order-of-magnitude n) - (let loop ([upper 10] [acc 0]) - (if (< n upper) - acc - (loop (* upper 10) (+ acc 1))))) - (define (save-pict fn p) (define bm (pict->bitmap p)) (send bm save-file fn 'png)) @@ -527,27 +518,6 @@ (check-exn exn:fail:contract? (λ () (log2 72)))) - (test-case "order-of-magnitude" - (check-apply* order-of-magnitude - [0 - ==> 0] - [1 - ==> 0] - [5 - ==> 0] - [9 - ==> 0] - [10 - ==> 1] - [12.34 - ==> 1] - [999 - ==> 2] - [999.99999 - ==> 2] - [1032 - ==> 3])) - (test-case "file-remove-extension" (check-equal? (file-remove-extension "foo_tab.gz") "foo.tab") (check-equal? (file-remove-extension "a_b.c") "a.b")) diff --git a/scribblings/gtp-util.scrbl b/scribblings/gtp-util.scrbl index 05a6317..b1ff43f 100644 --- a/scribblings/gtp-util.scrbl +++ b/scribblings/gtp-util.scrbl @@ -13,7 +13,6 @@ racket/contract racket/path (only-in racket/math natural?) - (prefix-in rkt: (only-in racket/math order-of-magnitude)) (only-in openssl/md5 md5))] @(define (make-gtp-util-eval) (make-base-eval '(require gtp-util))) @@ -110,13 +109,6 @@ If you think one of these functions should "graduate" to another library Assumes @racket[n] is a power of 2. } -@defproc[(order-of-magnitude [n real?]) natural?]{ - Count the number of digits in the given number. - - @(let-syntax ([order-of-magnitude (make-rename-transformer #'rkt:order-of-magnitude)]) - @deprecated[#:what "function" @racket[order-of-magnitude]]{(from @racketmodname[racket/math])}) -} - @defproc[(file-remove-extension [ps path-string?]) path-string?]{ Remove the extension from the given filename. }