tiny rewrite, (integer + integer)/2

This commit is contained in:
rlar 2011-06-23 16:52:34 +00:00
parent 9ee308a2a5
commit 10615d5e73
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-06-23 Robert Larice
* src/ciderlib/oned/onemesh.c ,
* src/spicelib/devices/nbjt/nbjttemp.c :
tiny rewrite, (integer + integer)/2
2011-06-23 Robert Larice
* src/frontend/evaluate.c ,
* src/misc/hash.c ,

View File

@ -240,7 +240,7 @@ adjustBaseContact(ONEdevice *pDevice, int indexEB, int indexBC)
/* Initialize the base contact to be the center of the two junctions */
/* This should take care of uniform dopings. */
midPoint = (int)(0.5 * (indexEB + indexBC));
midPoint = (indexEB + indexBC) / 2;
newBaseIndex = midPoint;
if (pBaseNode->baseType == P_TYPE) {

View File

@ -117,7 +117,7 @@ NBJTtemp(GENmodel *inModel, CKTcircuit *ckt)
printf("Warning: base contact not on node -- adjusting contact\n");
}
NBJTjunctions(pDevice, &indexBE, &indexBC);
pDevice->baseIndex = (int)(0.5 * (indexBE + indexBC));
pDevice->baseIndex = (indexBE + indexBC) / 2;
}
if (inst->NBJTtype == PNP) {
pDevice->elemArray[pDevice->baseIndex]->pNodes[0]->baseType = N_TYPE;