From 09ed5b9403a8dce52630cb67159a89eedfc6a245 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 15:56:31 -0800 Subject: [PATCH 1/6] remove extflonum support for CS compatibility --- describe/float-test-extended.rkt | 27 --------------------------- describe/main.rkt | 15 ++++++++++++--- describe/scribblings/describe.scrbl | 2 +- 3 files changed, 13 insertions(+), 31 deletions(-) delete mode 100644 describe/float-test-extended.rkt diff --git a/describe/float-test-extended.rkt b/describe/float-test-extended.rkt deleted file mode 100644 index 7923dd3..0000000 --- a/describe/float-test-extended.rkt +++ /dev/null @@ -1,27 +0,0 @@ -#lang racket/base - -(require racket/extflonum - "main.rkt") - -(printf "--- Using literals (extended precision) ---~n") -(describe 0.1t0) -(describe 0.2t0) -(describe 0.3t0) -(describe 0.4t0) -(describe 0.5t0) -(describe 0.6t0) -(describe 0.7t0) -(describe 0.8t0) -(describe 0.9t0) -(describe 1.0t0) - -(printf "--- Using summation (extended precision) ---~n") -(for/fold ((sum 0.0t0)) - ((i (in-range 10))) - (define new-sum (extfl+ sum 0.1t0)) - (describe new-sum) - new-sum) - -(printf "--- Using product (single precision) ---~n") -(for ((i (in-range 1 11))) - (describe (extfl* (->extfl i) 0.1t0))) diff --git a/describe/main.rkt b/describe/main.rkt index bd25a73..19ddbbe 100644 --- a/describe/main.rkt +++ b/describe/main.rkt @@ -71,7 +71,6 @@ ;;; 2.0.1 09/26/13 Added bigfloat support to float->string. (MDW) (require racket/contract/base - racket/extflonum racket/math racket/mpair) @@ -307,7 +306,7 @@ (format "~s is an exact number" z)))) ;;; (float->string x) -> string? -;;; x : (or/c flonum? single-flonum? extflonum? bigfloat?) +;;; x : (or/c flonum? single-flonum? bigfloat?) ;;; Returns a string with the exact decimal representation of x. This is only ;;; guaranteed for floats - single, double, or extended precision, which are ;;; never repeating decimals. @@ -403,6 +402,16 @@ (else (format "~s is a number" z)))) + +;;; 201223 Racket CS update +;;; Racket CS does not support extflonums +;;; so we remove racket/extflonum from depednencies +;;; and make the extflonum functions into no-ops +(define (extflonum? x) #false) +(define (extfl< . xs) #false) +(define (extfl> . xs) #false) +(define (extfl->exact x) 0) + ;;; (extflonum-description x) -> string ;;; x : extflonum? ;;; Returns a string describing the extended precision floating point number, x. @@ -843,7 +852,7 @@ (integer->string (-> exact-integer? string?)) (float->string - (-> (or/c flonum? single-flonum? extflonum?) string?)) + (-> (or/c flonum? single-flonum?) string?)) (description (-> any/c string?)) (describe diff --git a/describe/scribblings/describe.scrbl b/describe/scribblings/describe.scrbl index 32e6142..4311986 100644 --- a/describe/scribblings/describe.scrbl +++ b/describe/scribblings/describe.scrbl @@ -14,7 +14,7 @@ This library provides functions to describe Racket objects. Currently, the following types of objects are described: -@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloat support disabled (because of bugs related to v.5.3.x compatability.) The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} +@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloatsdisabled (because of incompatability with v.5.3) and extflonums disabled (because of incompatability with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} @itemize{ @item{Booleans} -- 2.25.1 From 85faff6a82e52071f6c98ee8cafc6b2f35785915 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 16:01:12 -0800 Subject: [PATCH 2/6] doc typo --- describe/scribblings/describe.scrbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/describe/scribblings/describe.scrbl b/describe/scribblings/describe.scrbl index 4311986..b173283 100644 --- a/describe/scribblings/describe.scrbl +++ b/describe/scribblings/describe.scrbl @@ -14,7 +14,7 @@ This library provides functions to describe Racket objects. Currently, the following types of objects are described: -@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloatsdisabled (because of incompatability with v.5.3) and extflonums disabled (because of incompatability with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} +@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloats disabled (because of incompatability with v.5.3) and extflonums disabled (because of incompatability with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} @itemize{ @item{Booleans} -- 2.25.1 From 7190021972335d9571f3786d675a92bbe458f073 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 16:03:23 -0800 Subject: [PATCH 3/6] more typoe --- describe/main.rkt | 2 +- describe/scribblings/describe.scrbl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/describe/main.rkt b/describe/main.rkt index 19ddbbe..9b27def 100644 --- a/describe/main.rkt +++ b/describe/main.rkt @@ -405,7 +405,7 @@ ;;; 201223 Racket CS update ;;; Racket CS does not support extflonums -;;; so we remove racket/extflonum from depednencies +;;; so we remove racket/extflonum from dependencies ;;; and make the extflonum functions into no-ops (define (extflonum? x) #false) (define (extfl< . xs) #false) diff --git a/describe/scribblings/describe.scrbl b/describe/scribblings/describe.scrbl index b173283..b5a2aea 100644 --- a/describe/scribblings/describe.scrbl +++ b/describe/scribblings/describe.scrbl @@ -14,7 +14,7 @@ This library provides functions to describe Racket objects. Currently, the following types of objects are described: -@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's new package system, and with bigfloats disabled (because of incompatability with v.5.3) and extflonums disabled (because of incompatability with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} +@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's current package system, and with bigfloats disabled (because of incompatibility with v.5.3) and extflonums disabled (because of incompatibility with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} @itemize{ @item{Booleans} @@ -80,7 +80,7 @@ Examples: @scheme[(integer->string (expt 10 150))] -> "at least 10^102" -@defproc[(float->string (x (or/c flonum? single-flonum? extflonum?))) string?]{ +@defproc[(float->string (x (or/c flonum? single-flonum?))) string?]{ Returns a string with the exact decimal value of the floating-point number @scheme[x]. This works for single precision, double precision, and extended precision values. Note that internally @scheme[x] is converted to an exact rational number as part of converting to a string.} Examples: -- 2.25.1 From 319547fbd187d2b7225e083f8e757fcb0a677868 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 16:09:18 -0800 Subject: [PATCH 4/6] remove more tests that cannot succeed --- describe/describe-test.rkt | 2 -- 1 file changed, 2 deletions(-) diff --git a/describe/describe-test.rkt b/describe/describe-test.rkt index 85b9db7..f549e12 100644 --- a/describe/describe-test.rkt +++ b/describe/describe-test.rkt @@ -47,11 +47,9 @@ (describe 0.0) (describe 0.1e0) (describe 0.1f0) -(describe 0.1t0) (describe (* (! 10) 1.0)) (describe 6.0221313e23) (describe 6.0221313f23) -(describe 6.0221313t23) (describe (exact->inexact (! 40))) (describe (sqrt 10)) (describe (sqrt -10)) -- 2.25.1 From 2b5974ad27225bead19627a704184b2fb636f5be Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 16:26:06 -0800 Subject: [PATCH 5/6] remove inexact imaginary numbers --- describe/describe-test.rkt | 5 +++-- describe/scribblings/describe.scrbl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/describe/describe-test.rkt b/describe/describe-test.rkt index f549e12..60cb4d1 100644 --- a/describe/describe-test.rkt +++ b/describe/describe-test.rkt @@ -52,8 +52,9 @@ (describe 6.0221313f23) (describe (exact->inexact (! 40))) (describe (sqrt 10)) -(describe (sqrt -10)) -(describe (+ (sqrt 10) (sqrt -10))) +;; no good in Racket CS, for whatever reason +;;(describe (sqrt -10)) +;;(describe (+ (sqrt 10) (sqrt -10))) ;;; Strings diff --git a/describe/scribblings/describe.scrbl b/describe/scribblings/describe.scrbl index b5a2aea..7b24d1f 100644 --- a/describe/scribblings/describe.scrbl +++ b/describe/scribblings/describe.scrbl @@ -14,7 +14,7 @@ This library provides functions to describe Racket objects. Currently, the following types of objects are described: -@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's current package system, and with bigfloats disabled (because of incompatibility with v.5.3) and extflonums disabled (because of incompatibility with Racket CS). The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} +@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's current package system, but with bigfloats disabled (because of incompatibility with v.5.3) and extflonums disabled (because of incompatibility with Racket CS). Under Racket CS, I've also found that complex numbers with inexact coefficients for the imaginary part also seem to crash. So maybe stay away from those. The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} @itemize{ @item{Booleans} -- 2.25.1 From 1d4fcccfdefcdff08e0bb7f871a1e68e845ffb84 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 23 Dec 2020 16:30:02 -0800 Subject: [PATCH 6/6] doc typo --- describe/scribblings/describe.scrbl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/describe/scribblings/describe.scrbl b/describe/scribblings/describe.scrbl index 7b24d1f..1d53dc1 100644 --- a/describe/scribblings/describe.scrbl +++ b/describe/scribblings/describe.scrbl @@ -14,7 +14,7 @@ This library provides functions to describe Racket objects. Currently, the following types of objects are described: -@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's current package system, but with bigfloats disabled (because of incompatibility with v.5.3) and extflonums disabled (because of incompatibility with Racket CS). Under Racket CS, I've also found that complex numbers with inexact coefficients for the imaginary part also seem to crash. So maybe stay away from those. The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} +@margin-note{This is not the official version of Describe. It is the 1.5 version from PLaneT, retooled to use Racket's current package system, but with bigfloats disabled (because of incompatibility with v.5.3) and extflonums disabled (because of incompatibility with Racket CS). Under Racket CS, I've found that complex numbers with inexact coefficients for the imaginary part also seem to crash. Maybe stay away from those. The canonical version of Describe is on the @link["http://planet.racket-lang.org/display.ss?package=describe.plt&owner=williams" "PLaneT server"]. — MB} @itemize{ @item{Booleans} -- 2.25.1