From bcd1ad3987ed468e331e25339a2e5551f8e12765 Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sat, 9 Sep 2023 10:24:04 -0300 Subject: [PATCH 1/5] Update exact expt * Remove some of the very old systems, which probably nobody will be using anymore * The page listed only tests with exact rational base. Now we include a test with exact rational *exponent*, which is very interesting. --- surveys/exact-expt.md | 77 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/surveys/exact-expt.md b/surveys/exact-expt.md index 3807ade..bd8d6eb 100644 --- a/surveys/exact-expt.md +++ b/surveys/exact-expt.md @@ -1,9 +1,78 @@ # Exact expt -This tests whether exponentiation of exact numbers produces an exact result. The test expression was `(expt 1/3 3)`, except on systems without inexact rationals, where `(expt 3 3)` was substituted. +## Exact rational base -Exact exponentiation supported: Racket, Gauche, MIT, Gambit, Chicken with the `numbers` egg, Bigloo, Scheme48/scsh, Guile, Kawa, SISC, Chez, Vicare, Larceny, Ypsilon, Mosh, IronScheme, STklos, KSi, TinyScheme, Scheme 9, RScheme, S7, XLisp, Rep, UBM, Sizzle, Oaklisp, Sagittarius, Picrin, Owl Lisp, Chibi, Loko +This tests whether exponentiation of exact numbers produces an exact result. +The test expression was `(expt 1/3 3)`, except on systems without inexact rationals, where `(expt 3 3)` was substituted. -Only inexact exponentiation supported: plain Chicken, SCM, NexJ, JScheme, Unlikely, Elk, SXM, Dfsch, Inlab -No support or broken support for `expt`: SigScheme, Shoe, Mini-Scheme, SIOD, Schemik, Llava, FemtoLisp, LMU +| System | `(expt 1/3 3)` | `(expt 3 3)` | +|-------------|-----------------------|--------------| +| Bigloo | | 27 | +| Biwa | | 27 | +| Chez | 1/27 | | +| Chibi | 1/27 | | +| Chicken | 1/27 | | +| Elk | | 27 | +| Gambit | 1/27 | | +| Gauche | 1/27 | | +| Guile | 1/27 | | +| Kawa | 1/27 | | +| LIPS | 1/27 | | +| Loko | 1/27 | | +| MIT | 1/27 | | +| Racket | 1/27 | | +| Sagittarius | 1/27 | | +| Scheme48 | 1/27 | | +| Scheme9 | | 27 | +| SCM | 3.7037037037037035e-2 | | +| STklos | 1/27 | | +| Tinyscheme | | 27 | + + +## Exact rational exponent + +What happens when the exponent is an exact rational, the base is exact, and it *would* be possible to return an exact result? + +The following expression was evaluated: + +``` +(expt 81 1/4) +``` + +Implementations that do not support rationals are not included. +Some Common Lisp systems were also checked, for comparison. + +| system | `(expt 81 1/4)` | +|-------------|--------------------| +| Chez | 3.0 | +| Chibi | 3.0 | +| Chicken | 3 | +| Gambit | 3 | +| Gauche | 3 | +| Guile | 3.0 | +| Kawa | 3.0 | +| LIPS | error | +| Loko | 3.000000238418579 | +| MIT | 3.0 | +| Racket | 2.0 | +| Sagittarius | 3.0 | +| Scheme48 | 3.0000000000000004 | +| STklos | 3.0000000000000004 | +|-------------|--------------------| +| ABCL | 3.0 | +| CCL | 3.0 | +| Clisp | 3 | +| ECL | 3.0 | +| GCL | 3.0000000000000006 | +| SBCL | 3.0 | + +* The systems with result `3.0` in the first column are those where `(= 3.0 (expt 81 1/4))` is true. + In the other systems, which do not return the precise `3.0` floating-point representation, the + returned value indicates at least one digit where it differs from 3.0. + +* The test `(= 3.0 (expt 81 1/4))` was necessary, since we do not know if `3.0` actually means a + precise representation of the number. For example, STklos will answer `3.0`, but after changing + the default print precision with `(real-precision 50)`, it will show that the number is not + the same as `3.0`. + From ded1b092c6484eb05480137285d37028dee66da4 Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sat, 9 Sep 2023 12:08:45 -0300 Subject: [PATCH 2/5] Fix typo 2.0 -> 3.0 --- surveys/exact-expt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/surveys/exact-expt.md b/surveys/exact-expt.md index bd8d6eb..0aea277 100644 --- a/surveys/exact-expt.md +++ b/surveys/exact-expt.md @@ -55,7 +55,7 @@ Some Common Lisp systems were also checked, for comparison. | LIPS | error | | Loko | 3.000000238418579 | | MIT | 3.0 | -| Racket | 2.0 | +| Racket | 3.0 | | Sagittarius | 3.0 | | Scheme48 | 3.0000000000000004 | | STklos | 3.0000000000000004 | From e17f7c4b6834fbf252a726e09b7066de18afeff1 Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sat, 9 Sep 2023 13:06:37 -0300 Subject: [PATCH 3/5] Include SCM --- surveys/exact-expt.md | 1 + 1 file changed, 1 insertion(+) diff --git a/surveys/exact-expt.md b/surveys/exact-expt.md index 0aea277..ee996cb 100644 --- a/surveys/exact-expt.md +++ b/surveys/exact-expt.md @@ -58,6 +58,7 @@ Some Common Lisp systems were also checked, for comparison. | Racket | 3.0 | | Sagittarius | 3.0 | | Scheme48 | 3.0000000000000004 | +| SCM | 3.0 | | STklos | 3.0000000000000004 | |-------------|--------------------| | ABCL | 3.0 | From b4c11fcf90c91719a91bad5d342ef9bf545a133d Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sun, 7 Apr 2024 13:51:08 -0300 Subject: [PATCH 4/5] Fix LIPS result for (expt 81 1/4) --- surveys/exact-expt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/surveys/exact-expt.md b/surveys/exact-expt.md index ee996cb..97e1449 100644 --- a/surveys/exact-expt.md +++ b/surveys/exact-expt.md @@ -52,7 +52,7 @@ Some Common Lisp systems were also checked, for comparison. | Gauche | 3 | | Guile | 3.0 | | Kawa | 3.0 | -| LIPS | error | +| LIPS | 3 | | Loko | 3.000000238418579 | | MIT | 3.0 | | Racket | 3.0 | From f7af93888f7c2499b0ec79d955d8e4a0b38edc8b Mon Sep 17 00:00:00 2001 From: Jeronimo Pellegrini Date: Sun, 7 Apr 2024 13:52:14 -0300 Subject: [PATCH 5/5] Fix thinko (inexact -> exact) Thanks to Jakub T. Jankiewicz. --- surveys/exact-expt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/surveys/exact-expt.md b/surveys/exact-expt.md index 97e1449..1af4539 100644 --- a/surveys/exact-expt.md +++ b/surveys/exact-expt.md @@ -3,7 +3,7 @@ ## Exact rational base This tests whether exponentiation of exact numbers produces an exact result. -The test expression was `(expt 1/3 3)`, except on systems without inexact rationals, where `(expt 3 3)` was substituted. +The test expression was `(expt 1/3 3)`, except on systems without exact rationals, where `(expt 3 3)` was substituted. | System | `(expt 1/3 3)` | `(expt 3 3)` |