diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-01-18 06:42:10 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-01-18 06:42:10 -0800 |
commit | 166927780f449e7b0c77345cad3150684d42d150 (patch) | |
tree | 917e60ffcc24e1970f1768369734dd2542a03e22 /rand.h | |
parent | 4a9d763799c3f0b3c17182b44e8497e174547120 (diff) | |
download | txr-166927780f449e7b0c77345cad3150684d42d150.tar.gz txr-166927780f449e7b0c77345cad3150684d42d150.tar.bz2 txr-166927780f449e7b0c77345cad3150684d42d150.zip |
New random-state-get-vec function.
* arith.c (UINT_PTR_MAX_MP): New static variable.
(biggnum_from_uintptr): New function.
(in_uint_ptr_range): New static function.
(c_uint_ptr_num): New function.
(arith_init): Initialize UINT_PTR_MAX_MP.
* arith.h (bignum_from_uintptr, c_uint_ptr_num): Declared.
* eval.c (eval_init): Register random-state-get-vec.
* mpi/mpi.c (mp_set_uintptr, mp_get_uintptr): New functions.
(mp_set_intptr, mp_get_intptr): Expressed in terms of
mp_set_uintptr and mp_get_uintptr.
* mpi/mpi.h (mp_set_uintptr, mp_get_uintptr): Declared.
* rand.c (make_random_state): Handle vector seed.
(random_state_get_vec): New function.
* rand.h (random_state_get_vec): Declared.
* txr.1: Documented new feature in make-random-state
and new random-state-get-vec function.
Diffstat (limited to 'rand.h')
-rw-r--r-- | rand.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -27,6 +27,7 @@ #define random_state (deref(lookup_var_l(nil, random_state_var_s))) extern val random_state_s, random_state_var_s; val make_random_state(val seed); +val random_state_get_vec(val state); val random_state_p(val obj); val random_fixnum(val state); val random(val state, val modulus); |