mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Added bitwise and/or
This commit is contained in:
parent
eb7ac51e95
commit
e51092c8c1
2 changed files with 18 additions and 0 deletions
|
@ -258,6 +258,8 @@ object Cyc_sum(void *data, object cont, int argc, object n, ...);
|
|||
object Cyc_sub(void *data, object cont, int argc, object n, ...);
|
||||
object Cyc_mul(void *data, object cont, int argc, object n, ...);
|
||||
object Cyc_div(void *data, object cont, int argc, object n, ...);
|
||||
object Cyc_bit_and(void *data, object n1, object n2);
|
||||
object Cyc_bit_or(void *data, object n1, object n2);
|
||||
object Cyc_num_op_va_list(void *data, int argc,
|
||||
object(fn_op(void *, common_type *, object)),
|
||||
int default_no_args, int default_one_arg, object n,
|
||||
|
|
16
runtime.c
16
runtime.c
|
@ -4500,6 +4500,22 @@ void vpbuffer_free(void **buf)
|
|||
free(buf);
|
||||
}
|
||||
|
||||
object Cyc_bit_and(void *data, object n1, object n2)
|
||||
{
|
||||
Cyc_check_int(data, n1);
|
||||
Cyc_check_int(data, n2);
|
||||
return (obj_int2obj(
|
||||
obj_obj2int(n1) & obj_obj2int(n2)));
|
||||
}
|
||||
|
||||
object Cyc_bit_or(void *data, object n1, object n2)
|
||||
{
|
||||
Cyc_check_int(data, n1);
|
||||
Cyc_check_int(data, n2);
|
||||
return (obj_int2obj(
|
||||
obj_obj2int(n1) | obj_obj2int(n2)));
|
||||
}
|
||||
|
||||
/* RNG section */
|
||||
#define norm 2.328306549295728e-10
|
||||
#define m1 4294967087.0
|
||||
|
|
Loading…
Add table
Reference in a new issue