LispCookbook / LispCookbook/cl-cookbook
Misleading information in section "Rational types"
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 158
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 2
Description
The type bignum is specified to be exactly (and integer (not fixnum)), which, along with the first line of this paragraph, would then mean that 1/2 is not a valid ratio because neither 1 and 2 are bignums.
I'd rather say something similar to the specification: that numerator and denominator are both integers, their GCD is 1, and numerator must be greater than 1.
I'd also mention that the conversion between ratio and integer is automatic so the programmer doesn't need to worry about overflows or underflows or imprecise computation, but also means that it's easily possible to reach bignum arithmetic and therefore get computation that is slower and consing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open numbers.md and inspect the "Rational types" section at the linked lines. Revise the description to state the integer, coprime numerator and denominator requirements, then add the requested explanation of automatic ratio/integer conversion and its possible bignum performance and consing costs. Done means the section is accurate and no longer implies that 1/2 is invalid.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100