define (scheme inexact) library

This commit is contained in:
Yuichi Nishiwaki
2013-12-10 05:40:44 -08:00
parent 6dc66d354c
commit cdb1911f9f
2 changed files with 22 additions and 13 deletions
+3
View File
@@ -337,6 +337,9 @@
(values (truncate-quotient n m)
(truncate-remainder n m)))
; (import (only (scheme inexact) sqrt))
(import (scheme inexact))
(define (exact-integer-sqrt k)
(let ((n (exact (sqrt k))))
(values n (- k (square n)))))