Added inexact?
This commit is contained in:
parent
0bbbcf9604
commit
ad1c469ffb
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -1002,14 +1002,6 @@
|
||||||
[else
|
[else
|
||||||
(error 'inexact "~s is not a number" x)])))
|
(error 'inexact "~s is not a number" x)])))
|
||||||
|
|
||||||
(define inexact?
|
|
||||||
(lambda (x)
|
|
||||||
(cond
|
|
||||||
[(fixnum? x) #f]
|
|
||||||
[(bignum? x) #f]
|
|
||||||
[(flonum? x) #t]
|
|
||||||
[else
|
|
||||||
(error 'inexact? "~s is not a number" x)])))
|
|
||||||
|
|
||||||
(define positive-bignum?
|
(define positive-bignum?
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
(library (ikarus predicates)
|
(library (ikarus predicates)
|
||||||
|
|
||||||
(export fixnum? flonum? bignum? ratnum? number? complex? real? rational?
|
(export fixnum? flonum? bignum? ratnum? number? complex? real? rational?
|
||||||
integer? exact? 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=?)
|
symbol=?)
|
||||||
|
|
||||||
(import
|
(import
|
||||||
(except (ikarus) fixnum? flonum? bignum? ratnum? number? complex? real?
|
(except (ikarus) fixnum? flonum? bignum? ratnum? number? complex? real?
|
||||||
rational? integer? exact? eof-object? bwp-object?
|
rational? integer? exact? inexact? eof-object? bwp-object?
|
||||||
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=?)
|
||||||
|
@ -99,6 +99,17 @@
|
||||||
[else
|
[else
|
||||||
(error 'exact? "~s is not a number" x)])))
|
(error 'exact? "~s is not a number" x)])))
|
||||||
|
|
||||||
|
|
||||||
|
(define inexact?
|
||||||
|
(lambda (x)
|
||||||
|
(cond
|
||||||
|
[(sys:flonum? x) #t]
|
||||||
|
[(sys:fixnum? x) #f]
|
||||||
|
[(sys:bignum? x) #f]
|
||||||
|
[(sys:ratnum? x) #f]
|
||||||
|
[else
|
||||||
|
(error 'inexact? "~s is not a number" x)])))
|
||||||
|
|
||||||
(define eof-object? (lambda (x) (sys:eof-object? x)))
|
(define eof-object? (lambda (x) (sys:eof-object? x)))
|
||||||
(define bwp-object? (lambda (x) (sys:bwp-object? x)))
|
(define bwp-object? (lambda (x) (sys:bwp-object? x)))
|
||||||
(define immediate? (lambda (x) (sys:immediate? x)))
|
(define immediate? (lambda (x) (sys:immediate? x)))
|
||||||
|
|
|
@ -479,6 +479,7 @@
|
||||||
[ratnum? i]
|
[ratnum? i]
|
||||||
[integer? i r]
|
[integer? i r]
|
||||||
[exact? i r]
|
[exact? i r]
|
||||||
|
[inexact? i r]
|
||||||
[rational? i r]
|
[rational? i r]
|
||||||
[flonum? i]
|
[flonum? i]
|
||||||
[positive? i r]
|
[positive? i r]
|
||||||
|
|
|
@ -155,7 +155,7 @@
|
||||||
[gcd C ba se]
|
[gcd C ba se]
|
||||||
[imag-part D ba se]
|
[imag-part D ba se]
|
||||||
[inexact C ba]
|
[inexact C ba]
|
||||||
[inexact? S ba se]
|
[inexact? C ba se]
|
||||||
[infinite? S ba]
|
[infinite? S ba]
|
||||||
[integer->char C ba se]
|
[integer->char C ba se]
|
||||||
[integer-valued? S ba]
|
[integer-valued? S ba]
|
||||||
|
|
Loading…
Reference in New Issue