mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
(scm_array_fill_x): For fvect and dvect, use scm_num2dbl to
convert args the same way that array-set! does.
This commit is contained in:
parent
8418f0c740
commit
ac3c6ad6cf
1 changed files with 3 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1996,1998,2000,2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1996,1998,2000,2001,2004 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -564,8 +564,7 @@ scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED)
|
||||||
case scm_tc7_fvect:
|
case scm_tc7_fvect:
|
||||||
{ /* scope */
|
{ /* scope */
|
||||||
float f, *ve = (float *) SCM_VELTS (ra);
|
float f, *ve = (float *) SCM_VELTS (ra);
|
||||||
SCM_ASRTGO (SCM_REALP (fill), badarg2);
|
f = (float) scm_num2dbl (fill, FUNC_NAME);
|
||||||
f = SCM_REAL_VALUE (fill);
|
|
||||||
for (i = base; n--; i += inc)
|
for (i = base; n--; i += inc)
|
||||||
ve[i] = f;
|
ve[i] = f;
|
||||||
break;
|
break;
|
||||||
|
@ -573,8 +572,7 @@ scm_array_fill_int (SCM ra, SCM fill, SCM ignore SCM_UNUSED)
|
||||||
case scm_tc7_dvect:
|
case scm_tc7_dvect:
|
||||||
{ /* scope */
|
{ /* scope */
|
||||||
double f, *ve = (double *) SCM_VELTS (ra);
|
double f, *ve = (double *) SCM_VELTS (ra);
|
||||||
SCM_ASRTGO (SCM_REALP (fill), badarg2);
|
f = scm_num2dbl (fill, FUNC_NAME);
|
||||||
f = SCM_REAL_VALUE (fill);
|
|
||||||
for (i = base; n--; i += inc)
|
for (i = base; n--; i += inc)
|
||||||
ve[i] = f;
|
ve[i] = f;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue