question about cochran.c
paulbuxton.mail at googlemail.com
Tue Oct 29 05:33:54 PDT 2019
Would it not be better to implement it as a macro so that we only have
the logic once and avoid this kind of issue.
On Tue, Oct 29, 2019 at 12:00 PM Dirk Hohndel <dirk at hohndel.org> wrote:
> On Tue, Oct 29, 2019 at 12:34:35PM +0100, Dirk Hohndel wrote:
> > A quick grep shows me that this is the odd one out:
> > $ grep 1\\.8 core/cochran.c
> > sample->temperature.mkelvin = C_to_mkelvin((temp - 32) / 1.8);
> > dc->watertemp.mkelvin = C_to_mkelvin((log[CMD_MIN_TEMP] / 32.0) - 1.8);
> > dc->watertemp.mkelvin = C_to_mkelvin((log[EMC_MIN_TEMP] - 32) / 1.8);
> > dc->watertemp.mkelvin = C_to_mkelvin((min_temp - 32) / 1.8);
> > Yeah, that seems to make more sense. And ideally, all of them should do
> > the division in floating point (dividing by 32.0).
> Forget that last part - not enough coffee... we should not be dividing by
> 32 in the first place... so I think the only thing that needs to change is
> the division / subtraction signs in that one line... and the grep above
> was from my first naive / stupid attempt to fix this without thinking, so
> in master this reads as in the line further up...
> subsurface mailing list
> subsurface at subsurface-divelog.org
More information about the subsurface