SCALE_R: division by zero

Begonnen von Pessimister, 03. Oktober 2010, 05:16:38

Vorheriges Thema - Nächstes Thema

0 Mitglieder und 2 Gäste betrachten dieses Thema.

Pessimister

If I_LO = I_HI, a division by zero takes place:

SCALE_R := (O_HI - O_LO) / (I_HI - I_LO) * (LIMIT(I_LO, X, I_HI) - I_LO) + O_LO;

I propose to return O_LO in this case.

hugo

thanks very much for your report.

we will update all scale function in the next release to avoid a possible divide by 0