-
Notifications
You must be signed in to change notification settings - Fork 4
Update "exact expt" #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jpellegrini
wants to merge
5
commits into
schemedoc:master
Choose a base branch
from
jpellegrini:exact-expt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,79 @@ | ||
| # 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 | 3.0 | | ||
| | Sagittarius | 3.0 | | ||
| | Scheme48 | 3.0000000000000004 | | ||
| | SCM | 3.0 | | ||
| | 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`. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.