Lines Matching refs:exp
77 int exp = 0; in simple_div() local
89 exp++; in simple_div()
91 *micro_frac = (rem / divisor) * pow_10(6-exp); in simple_div()
95 static void split_micro_fraction(unsigned int no, int exp, int *val1, int *val2) in split_micro_fraction() argument
97 *val1 = no/pow_10(exp); in split_micro_fraction()
98 *val2 = no%pow_10(exp) * pow_10(6-exp); in split_micro_fraction()
109 static void convert_from_vtf_format(u32 value, int size, int exp, in convert_from_vtf_format() argument
118 exp = hid_sensor_convert_exponent(exp); in convert_from_vtf_format()
119 if (exp >= 0) { in convert_from_vtf_format()
120 *val1 = sign * value * pow_10(exp); in convert_from_vtf_format()
123 split_micro_fraction(value, -exp, val1, val2); in convert_from_vtf_format()
131 static u32 convert_to_vtf_format(int size, int exp, int val1, int val2) in convert_to_vtf_format() argument
138 exp = hid_sensor_convert_exponent(exp); in convert_to_vtf_format()
139 if (exp < 0) { in convert_to_vtf_format()
140 value = abs(val1) * pow_10(-exp); in convert_to_vtf_format()
141 value += abs(val2) / pow_10(6+exp); in convert_to_vtf_format()
143 value = abs(val1) / pow_10(exp); in convert_to_vtf_format()
278 int scale1, int exp) in adjust_exponent_micro() argument
285 if (exp > 0) { in adjust_exponent_micro()
286 *val0 = scale0 * pow_10(exp); in adjust_exponent_micro()
288 if (exp > 6) { in adjust_exponent_micro()
292 for (i = 0; i < exp; ++i) { in adjust_exponent_micro()
294 res += (pow_10(exp - 1 - i) * x); in adjust_exponent_micro()
298 *val1 = scale1 * pow_10(exp); in adjust_exponent_micro()
299 } else if (exp < 0) { in adjust_exponent_micro()
300 exp = abs(exp); in adjust_exponent_micro()
301 if (exp > 6) { in adjust_exponent_micro()
305 *val0 = scale0 / pow_10(exp); in adjust_exponent_micro()
306 rem = scale0 % pow_10(exp); in adjust_exponent_micro()
308 for (i = 0; i < (6 - exp); ++i) { in adjust_exponent_micro()
310 res += (pow_10(5 - exp - i) * x); in adjust_exponent_micro()
313 *val1 = rem * pow_10(6 - exp) + res; in adjust_exponent_micro()
325 int exp; in hid_sensor_format_scale() local
333 exp = hid_sensor_convert_exponent( in hid_sensor_format_scale()
337 unit_conversion[i].scale_val1, exp); in hid_sensor_format_scale()