mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 03:36:34 +02:00
Add stub for rationalize
This commit is contained in:
parent
88fb4b909f
commit
e4992492b3
2 changed files with 5 additions and 6 deletions
|
@ -5,6 +5,7 @@
|
|||
Features
|
||||
|
||||
- Enhanced the reader to parse rationals and store them as inexact numbers.
|
||||
- Add a stub for `(rationalize x y)` to `(scheme base)`.
|
||||
|
||||
Bug Fixes
|
||||
|
||||
|
|
|
@ -205,15 +205,10 @@
|
|||
write-u8
|
||||
binary-port?
|
||||
textual-port?
|
||||
|
||||
rationalize
|
||||
;;;;
|
||||
; Possibly missing functions:
|
||||
;
|
||||
; u8-ready?
|
||||
;
|
||||
; ; No complex or rational numbers at this time
|
||||
; rationalize
|
||||
;
|
||||
; ;; syntax-rules
|
||||
;;;;
|
||||
)
|
||||
|
@ -1483,6 +1478,9 @@
|
|||
"(void *data, object ptr, object z)"
|
||||
" return Cyc_is_complex(z); ")
|
||||
(define rational? number?)
|
||||
;; Stub, doesn't do much now because rationals are not supported
|
||||
(define (rationalize x y)
|
||||
(/ x y))
|
||||
(define (max first . rest) (foldl (lambda (old new) (if (> old new) old new)) first rest))
|
||||
(define (min first . rest) (foldl (lambda (old new) (if (< old new) old new)) first rest))
|
||||
; Implementations of gcd and lcm using Euclid's algorithm
|
||||
|
|
Loading…
Add table
Reference in a new issue