`[]' indexing operator, round index to nearest integer
This commit is contained in:
parent
71a9a526cd
commit
2968fb3a97
|
|
@ -1,3 +1,7 @@
|
|||
2011-06-23 Robert Larice
|
||||
* src/frontend/evaluate.c :
|
||||
`[]' indexing operator, round index to nearest integer
|
||||
|
||||
2011-06-23 Robert Larice
|
||||
* src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod :
|
||||
malloc return value cast
|
||||
|
|
|
|||
|
|
@ -716,11 +716,11 @@ op_ind(struct pnode *arg1, struct pnode *arg2)
|
|||
*/
|
||||
if (isreal(ind)) {
|
||||
newdim = v->v_numdims - 1;
|
||||
down = up = (int)(ind->v_realdata[0]);
|
||||
down = up = (int)floor(ind->v_realdata[0] + 0.5);
|
||||
} else {
|
||||
newdim = v->v_numdims;
|
||||
down = (int)(realpart(&ind->v_compdata[0]));
|
||||
up = (int)(imagpart(&ind->v_compdata[0]));
|
||||
down = (int)floor(realpart(&ind->v_compdata[0]) + 0.5);
|
||||
up = (int)floor(imagpart(&ind->v_compdata[0]) + 0.5);
|
||||
}
|
||||
if (up < down) {
|
||||
i = up;
|
||||
|
|
|
|||
Loading…
Reference in New Issue