X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdmm%2Fdtm0660.c;h=42012399e22195a2b3ee10e1f5dcfe4f7cfc642f;hb=fe185e4990edba03faf6485dcd6a42aeb3b9a008;hp=86b6ccf7df2e6422ae60c17df3801d236a3f4d7f;hpb=94b1d5064276df8047fec8cbb61346ede9123f8d;p=libsigrok.git diff --git a/src/dmm/dtm0660.c b/src/dmm/dtm0660.c index 86b6ccf7..42012399 100644 --- a/src/dmm/dtm0660.c +++ b/src/dmm/dtm0660.c @@ -254,6 +254,8 @@ static void parse_flags(const uint8_t *buf, struct dtm0660_info *info) static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, int *exponent, const struct dtm0660_info *info) { + int initial_exponent = *exponent; + /* Factors */ if (info->is_nano) *exponent -= 9; @@ -265,7 +267,7 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, *exponent += 3; if (info->is_mega) *exponent += 6; - *floatval *= powf(10, *exponent); + *floatval *= powf(10, (*exponent - initial_exponent)); /* Measurement modes */ if (info->is_volt) {