Lines Matching refs:exp
80 int exp = 0; in simple_div() local
92 exp++; in simple_div()
94 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp); in simple_div()
98 static void split_micro_fraction(unsigned int no, int exp, int *val1, int *val2) in split_micro_fraction() argument
100 int divisor = int_pow(10, exp); in split_micro_fraction()
103 *val2 = no % divisor * int_pow(10, 6 - exp); in split_micro_fraction()
114 static void convert_from_vtf_format(u32 value, int size, int exp, in convert_from_vtf_format() argument
123 exp = hid_sensor_convert_exponent(exp); in convert_from_vtf_format()
124 if (exp >= 0) { in convert_from_vtf_format()
125 *val1 = sign * value * int_pow(10, exp); in convert_from_vtf_format()
128 split_micro_fraction(value, -exp, val1, val2); in convert_from_vtf_format()
136 static u32 convert_to_vtf_format(int size, int exp, int val1, int val2) in convert_to_vtf_format() argument
144 exp = hid_sensor_convert_exponent(exp); in convert_to_vtf_format()
145 if (exp < 0) { in convert_to_vtf_format()
146 divisor = int_pow(10, 6 + exp); in convert_to_vtf_format()
147 value = abs(val1) * int_pow(10, -exp); in convert_to_vtf_format()
150 divisor = int_pow(10, exp); in convert_to_vtf_format()
307 int scale1, int exp) in adjust_exponent_nano() argument
315 if (exp > 0) { in adjust_exponent_nano()
316 *val0 = scale0 * int_pow(10, exp); in adjust_exponent_nano()
318 if (exp > 9) { in adjust_exponent_nano()
322 for (i = 0; i < exp; ++i) { in adjust_exponent_nano()
325 res += int_pow(10, exp - 1 - i) * x; in adjust_exponent_nano()
329 *val1 = scale1 * int_pow(10, exp); in adjust_exponent_nano()
330 } else if (exp < 0) { in adjust_exponent_nano()
331 exp = abs(exp); in adjust_exponent_nano()
332 if (exp > 9) { in adjust_exponent_nano()
336 divisor = int_pow(10, exp); in adjust_exponent_nano()
340 for (i = 0; i < (9 - exp); ++i) { in adjust_exponent_nano()
343 res += int_pow(10, 8 - exp - i) * x; in adjust_exponent_nano()
346 *val1 = rem * int_pow(10, 9 - exp) + res; in adjust_exponent_nano()
358 int exp; in hid_sensor_format_scale() local
366 exp = hid_sensor_convert_exponent( in hid_sensor_format_scale()
370 unit_conversion[i].scale_val1, exp); in hid_sensor_format_scale()