mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Slightly faster (exact-integer?)
This commit is contained in:
parent
2dbe2e004f
commit
75b50d8269
1 changed files with 13 additions and 3 deletions
|
@ -214,7 +214,6 @@
|
||||||
;;;;
|
;;;;
|
||||||
)
|
)
|
||||||
(inline
|
(inline
|
||||||
exact-integer?
|
|
||||||
square
|
square
|
||||||
quotient
|
quotient
|
||||||
numerator
|
numerator
|
||||||
|
@ -1262,8 +1261,19 @@
|
||||||
" return_inexact_double_op(data, k, sqrt, z);"
|
" return_inexact_double_op(data, k, sqrt, z);"
|
||||||
"(void *data, object ptr, object z)"
|
"(void *data, object ptr, object z)"
|
||||||
" return_inexact_double_op_no_cps(data, ptr, sqrt, z);")
|
" return_inexact_double_op_no_cps(data, ptr, sqrt, z);")
|
||||||
(define (exact-integer? num)
|
(define-c exact-integer?
|
||||||
(and (exact? num) (integer? num)))
|
"(void *data, int argc, closure _, object k, object num)"
|
||||||
|
" if (obj_is_int(num) || (num != NULL && !is_value_type(num) &&
|
||||||
|
(type_of(num) == integer_tag ||
|
||||||
|
type_of(num) == bignum_tag)))
|
||||||
|
return_closcall1(data, k, boolean_t);
|
||||||
|
return_closcall1(data, k, boolean_f); "
|
||||||
|
"(void *data, object ptr, object num)"
|
||||||
|
" if (obj_is_int(num) || (num != NULL && !is_value_type(num) &&
|
||||||
|
(type_of(num) == integer_tag ||
|
||||||
|
type_of(num) == bignum_tag)))
|
||||||
|
return boolean_t;
|
||||||
|
return boolean_f;")
|
||||||
(define-c exact?
|
(define-c exact?
|
||||||
"(void *data, int argc, closure _, object k, object num)"
|
"(void *data, int argc, closure _, object k, object num)"
|
||||||
" Cyc_check_num(data, num);
|
" Cyc_check_num(data, num);
|
||||||
|
|
Loading…
Add table
Reference in a new issue