Created
June 3, 2017 01:27
-
-
Save carld/cd1f396e2c43987e7c33316d35697689 to your computer and use it in GitHub Desktop.
LLVM literal float representation from Chez Scheme
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
| (define (float->hex fl) | |
| (string-append "0x" | |
| (with-output-to-string | |
| (lambda () | |
| (write-ieee-float32 fl | |
| (make-output-port | |
| (lambda (m . args) | |
| (case m | |
| ((write-char) | |
| (format #t "~X" (char->integer (car args)))))) (make-string 0)) | |
| 'big-endian | |
| ))) "00000000" )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment