floating-point-bytes->real and real->floating-point-bytes are not inverses for all inputs
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 5.2k
- Forks
- 698
- Avg merge
- 18h 34m
- Merged PRs (30d)
- 5
Description
What version of Racket are you using?
v8.5.0.2 [cs]
What program did you run?
(define input (bytes #x7f #x80 #x01 #x01))
(equal? input (real->floating-point-bytes (floating-point-bytes->real input #t 0 4) 4 #t))
What should have happened?
It should have answered #t, but it answered #f, because real->floating-point-bytes yielded (bytes #x7f #xc0 #x01 #x01).
Please include any other relevant details
x86_64 Debian linux.
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
Start by running the provided Racket program on v8.5.0.2 [cs] and compare floating-point-bytes->real with real->floating-point-bytes for the four-byte input on x86_64 Debian Linux. Trace these two functions to determine why the second byte changes from #x80 to #xc0, and consider the issue done when the round trip returns #t for this case and relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100