1:=> (integer? 6.0)
#t
1:=> (real? 6.0)
#t
1:=> (exact? 6.0)
#f
1:=> (inexact? 6.0)
#t
1:=> (vector-ref (make-vector 10 0) 6.0)
*** ERROR:_vector-ref:
Type `int' expected, `real' provided -- 6.0
0.interp
1.engine
2.main
1:=> (vector-ref (make-vector 10 0) 6)
0
1:=> (vector-ref (make-vector 10 0) (inexact->exact 6.0))
0
2006-11-20
Bigloo Scheme - simple type conversion
For a long time I looked for a function real->integer, it turned out that everything is much more easy.
tags:
scheme
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment