Dear hines,

I just checked on my old PC:

Inserting a printf("Hello world") instruction into "function nrn_dbl_truncate_precision()", it prints many times, for each iteration, the string "Hello world".

Instead, on MacBook this does not occur.

So in fadvance.c into "if (nrn_significand_precision) {...}" I've inserted a printf:

Code: Select all

```
static void update(NrnThread* _nt)
{
int i, i1, i2;
#define DEF_PRECISION 1
i1 = 0;
i2 = _nt->end;
#if DEF_PRECISION
{
int nrn_significand_precision;
double nrn_dbl_truncate(double);
if (nrn_significand_precision) {
[b]printf(" Into IF\n");[/b]
for (i = i1; i < i2; ++i) {
VEC_RHS(i) = nrn_dbl_truncate(VEC_RHS(i));
}
}
}
```

On MacBook it does not print. On my old PC it prints.

So I have understand that the problem depends on "nrn_significan_precision" value: in fact, printng its value (as integer "%d"), On MacBook it is always 0, on my old PC it alternates between 139712320 and 139712448.

Thus, I deleted the IF on fadvance.c:

Code: Select all

```
static void update(NrnThread* _nt)
{
int i, i1, i2;
#define DEF_PRECISION 1
i1 = 0;
i2 = _nt->end;
#if DEF_PRECISION
{
int nrn_significand_precision;
double nrn_dbl_truncate(double);
for (i = i1; i < i2; ++i) {
VEC_RHS(i) = nrn_dbl_truncate(VEC_RHS(i));
}
}
```

In this way, on MacBook hhchain.hoc runs:

Code: Select all

```
22.0516626398731006
22.0516626398923066
mantissa precision 53 bits, result diff 1.9206e-11
22.0516626398731006
22.0516626398923066
mantissa precision 52 bits, result diff 1.9206e-11
22.0516626401501981
22.0516626398808455
mantissa precision 51 bits, result diff -2.69353e-10
22.0516626398827142
22.0516626398672848
mantissa precision 50 bits, result diff -1.54294e-11
22.0516626401661107
22.0516626398747846
mantissa precision 49 bits, result diff -2.91326e-10
22.0516626398804121
22.0516626398990425
mantissa precision 48 bits, result diff 1.86304e-11
22.0516626398947579
22.0516626398793676
mantissa precision 47 bits, result diff -1.53904e-11
22.0516626398899831
22.0516626398858904
mantissa precision 46 bits, result diff -4.09273e-12
22.0516626401445563
22.0516626398567155
mantissa precision 45 bits, result diff -2.87841e-10
22.0516626401564864
22.0516626401397531
mantissa precision 44 bits, result diff -1.67333e-11
22.0516626398814921
22.0516626398833964
mantissa precision 43 bits, result diff 1.90425e-12
22.0516626398728661
22.051662639855671
mantissa precision 42 bits, result diff -1.71951e-11
22.0516626398422062
22.0516626400936246
mantissa precision 41 bits, result diff 2.51418e-10
22.051662639754241
22.051662639754241
mantissa precision 40 bits, result diff 0
22.0516626396554756
22.0516626396554756
mantissa precision 39 bits, result diff 0
22.0516626395717452
22.0516626395717452
mantissa precision 38 bits, result diff 0
22.0516626389630375
22.0516626389630375
mantissa precision 37 bits, result diff 0
22.0516626378978913
22.0516626378978913
mantissa precision 36 bits, result diff 0
22.0516626358508461
22.0516626358508461
mantissa precision 35 bits, result diff 0
22.051662630983202
22.051662630983202
mantissa precision 34 bits, result diff 0
22.051662624063411
22.051662624063411
mantissa precision 33 bits, result diff 0
22.0516626094371588
22.0516626094371588
mantissa precision 32 bits, result diff 0
32
```

Now, let me know if my modification can lead to errors.

Should however be noted that the values printed by the two PCs are slightly different; but I think this depends on the different architectures (32 and 64 bits).