* Added real-valued?, integer-valued? and rational-valued?
This commit is contained in:
parent
c55cad8502
commit
69d692417f
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -5,7 +5,8 @@
|
||||||
integer? exact? inexact? eof-object? bwp-object? immediate?
|
integer? exact? inexact? eof-object? bwp-object? immediate?
|
||||||
boolean? char? vector? bytevector? string? procedure? null? pair?
|
boolean? char? vector? bytevector? string? procedure? null? pair?
|
||||||
symbol? code? not weak-pair? eq? eqv? equal? boolean=?
|
symbol? code? not weak-pair? eq? eqv? equal? boolean=?
|
||||||
symbol=? finite? infinite? nan?)
|
symbol=? finite? infinite? nan? real-valued?
|
||||||
|
rational-valued? integer-valued?)
|
||||||
|
|
||||||
(import
|
(import
|
||||||
(except (ikarus) fixnum? flonum? bignum? ratnum? number? complex? real?
|
(except (ikarus) fixnum? flonum? bignum? ratnum? number? complex? real?
|
||||||
|
@ -13,7 +14,8 @@
|
||||||
immediate? boolean? char? vector? bytevector? string? procedure?
|
immediate? boolean? char? vector? bytevector? string? procedure?
|
||||||
null? pair? weak-pair? symbol? code? not eq? eqv? equal?
|
null? pair? weak-pair? symbol? code? not eq? eqv? equal?
|
||||||
port? input-port? output-port? boolean=? symbol=?
|
port? input-port? output-port? boolean=? symbol=?
|
||||||
finite? infinite? nan?)
|
finite? infinite? nan? real-valued? rational-valued?
|
||||||
|
integer-valued?)
|
||||||
(ikarus system $fx)
|
(ikarus system $fx)
|
||||||
(ikarus system $flonums)
|
(ikarus system $flonums)
|
||||||
(ikarus system $pairs)
|
(ikarus system $pairs)
|
||||||
|
@ -72,6 +74,9 @@
|
||||||
(define real?
|
(define real?
|
||||||
(lambda (x) (number? x)))
|
(lambda (x) (number? x)))
|
||||||
|
|
||||||
|
(define real-valued?
|
||||||
|
(lambda (x) (number? x)))
|
||||||
|
|
||||||
(define rational?
|
(define rational?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(cond
|
(cond
|
||||||
|
@ -79,7 +84,10 @@
|
||||||
[(sys:bignum? x) #t]
|
[(sys:bignum? x) #t]
|
||||||
[(sys:ratnum? x) #t]
|
[(sys:ratnum? x) #t]
|
||||||
[(sys:flonum? x) ($flonum-rational? x)]
|
[(sys:flonum? x) ($flonum-rational? x)]
|
||||||
[else (error 'rational? "~s is not a number" x)])))
|
[else #f])))
|
||||||
|
|
||||||
|
(define rational-valued?
|
||||||
|
(lambda (x) (rational? x)))
|
||||||
|
|
||||||
(define integer?
|
(define integer?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
@ -90,6 +98,9 @@
|
||||||
[(sys:flonum? x) ($flonum-integer? x)]
|
[(sys:flonum? x) ($flonum-integer? x)]
|
||||||
[else #f])))
|
[else #f])))
|
||||||
|
|
||||||
|
(define integer-valued?
|
||||||
|
(lambda (x) (integer? x)))
|
||||||
|
|
||||||
(define exact?
|
(define exact?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(cond
|
(cond
|
||||||
|
|
|
@ -510,6 +510,9 @@
|
||||||
[ratnum? i]
|
[ratnum? i]
|
||||||
[integer? i r]
|
[integer? i r]
|
||||||
[real? i r]
|
[real? i r]
|
||||||
|
[integer-valued? i]
|
||||||
|
[real-valued? i]
|
||||||
|
[rational-valued? i]
|
||||||
[flinteger? i]
|
[flinteger? i]
|
||||||
[flfinite? i]
|
[flfinite? i]
|
||||||
[flinfinite? i]
|
[flinfinite? i]
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
[inexact? C ba se]
|
[inexact? C ba se]
|
||||||
[infinite? C ba]
|
[infinite? C ba]
|
||||||
[integer->char C ba se]
|
[integer->char C ba se]
|
||||||
[integer-valued? S ba]
|
[integer-valued? C ba]
|
||||||
[integer? C ba se]
|
[integer? C ba se]
|
||||||
[lcm C ba se]
|
[lcm C ba se]
|
||||||
[length C ba se]
|
[length C ba se]
|
||||||
|
@ -190,11 +190,11 @@
|
||||||
[pair? C ba se]
|
[pair? C ba se]
|
||||||
[positive? C ba se]
|
[positive? C ba se]
|
||||||
[procedure? C ba se]
|
[procedure? C ba se]
|
||||||
[rational-valued? S ba]
|
[rational-valued? C ba]
|
||||||
[rational? C ba se]
|
[rational? C ba se]
|
||||||
[rationalize C ba se]
|
[rationalize C ba se]
|
||||||
[real-part D ba se]
|
[real-part D ba se]
|
||||||
[real-valued? S ba]
|
[real-valued? C ba]
|
||||||
[real? C ba se]
|
[real? C ba se]
|
||||||
[reverse C ba se]
|
[reverse C ba se]
|
||||||
[round C ba se]
|
[round C ba se]
|
||||||
|
|
Loading…
Reference in New Issue