int sig_digits, val_exp;
int digits;
enum sr_unit unit;
+ double limit;
scpi = sdi->conn;
devc = sdi->priv;
}
if (!response)
return SR_ERR;
- if (info->d_value > +9e37) {
+ limit = 9e37;
+ if (info->d_value > +limit) {
info->d_value = +INFINITY;
- } else if (info->d_value < -9e37) {
+ } else if (info->d_value < -limit) {
info->d_value = -INFINITY;
} else {
p = response;
}
if (!response)
return SR_ERR;
- if (info->d_value > +9e37) {
+ limit = 9e37;
+ if (info->d_value > +limit) {
info->d_value = +INFINITY;
- } else if (info->d_value < -9e37) {
+ } else if (info->d_value < -limit) {
info->d_value = -INFINITY;
} else {
p = response;
case 7:
case 16:
/* In resitance modes 0L reads as 1.20000E8 or 1.99999E8. */
+ limit = 1.2e8;
if (strcmp(devc->model->model, "GDM8255A") == 0)
limit = 1.99999e8;
- else
- limit = 1.2e8;
if (info->d_value >= limit)
info->d_value = +INFINITY;
break;