mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-19 18:20:22 +02:00
(scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
Discouraged by moving to discouraged.h and discouraged.c. Replaced all uses with scm_from_double. (scm_num2float, scm_num2double): Discouraged by moving prototype to discouraged.h and rewriting in terms of scm_to_double. Replaced all uses with scm_to_double.
This commit is contained in:
parent
8672c728f0
commit
d9a67fc441
8 changed files with 42 additions and 44 deletions
|
@ -357,8 +357,8 @@ SCM_DEFINE (scm_random, "random", 1, 1, 0,
|
|||
}
|
||||
SCM_VALIDATE_NIM (1, n);
|
||||
if (SCM_REALP (n))
|
||||
return scm_make_real (SCM_REAL_VALUE (n)
|
||||
* scm_c_uniform01 (SCM_RSTATE (state)));
|
||||
return scm_from_double (SCM_REAL_VALUE (n)
|
||||
* scm_c_uniform01 (SCM_RSTATE (state)));
|
||||
|
||||
if (!SCM_BIGP (n))
|
||||
SCM_WRONG_TYPE_ARG (1, n);
|
||||
|
@ -400,7 +400,7 @@ SCM_DEFINE (scm_random_uniform, "random:uniform", 0, 1, 0,
|
|||
if (SCM_UNBNDP (state))
|
||||
state = SCM_VARIABLE_REF (scm_var_random_state);
|
||||
SCM_VALIDATE_RSTATE (1, state);
|
||||
return scm_make_real (scm_c_uniform01 (SCM_RSTATE (state)));
|
||||
return scm_from_double (scm_c_uniform01 (SCM_RSTATE (state)));
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
@ -415,7 +415,7 @@ SCM_DEFINE (scm_random_normal, "random:normal", 0, 1, 0,
|
|||
if (SCM_UNBNDP (state))
|
||||
state = SCM_VARIABLE_REF (scm_var_random_state);
|
||||
SCM_VALIDATE_RSTATE (1, state);
|
||||
return scm_make_real (scm_c_normal01 (SCM_RSTATE (state)));
|
||||
return scm_from_double (scm_c_normal01 (SCM_RSTATE (state)));
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
@ -517,7 +517,7 @@ SCM_DEFINE (scm_random_normal_vector_x, "random:normal-vector!", 1, 1, 0,
|
|||
n = scm_to_int (scm_uniform_vector_length (v));
|
||||
if (SCM_VECTORP (v))
|
||||
while (--n >= 0)
|
||||
SCM_VECTOR_SET (v, n, scm_make_real (scm_c_normal01 (SCM_RSTATE (state))));
|
||||
SCM_VECTOR_SET (v, n, scm_from_double (scm_c_normal01 (SCM_RSTATE (state))));
|
||||
else
|
||||
while (--n >= 0)
|
||||
((double *) SCM_VELTS (v))[n] = scm_c_normal01 (SCM_RSTATE (state));
|
||||
|
@ -537,7 +537,7 @@ SCM_DEFINE (scm_random_exp, "random:exp", 0, 1, 0,
|
|||
if (SCM_UNBNDP (state))
|
||||
state = SCM_VARIABLE_REF (scm_var_random_state);
|
||||
SCM_VALIDATE_RSTATE (1, state);
|
||||
return scm_make_real (scm_c_exp1 (SCM_RSTATE (state)));
|
||||
return scm_from_double (scm_c_exp1 (SCM_RSTATE (state)));
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue