Lines Matching refs:exp
79 int exp = 0; in simple_div() local
91 exp++; in simple_div()
93 *micro_frac = (rem / divisor) * int_pow(10, 6 - exp); in simple_div()
97 static void split_micro_fraction(unsigned int no, int exp, int *val1, int *val2) in split_micro_fraction() argument
99 int divisor = int_pow(10, exp); in split_micro_fraction()
102 *val2 = no % divisor * int_pow(10, 6 - exp); in split_micro_fraction()
113 static void convert_from_vtf_format(u32 value, int size, int exp, in convert_from_vtf_format() argument
122 exp = hid_sensor_convert_exponent(exp); in convert_from_vtf_format()
123 if (exp >= 0) { in convert_from_vtf_format()
124 *val1 = sign * value * int_pow(10, exp); in convert_from_vtf_format()
127 split_micro_fraction(value, -exp, val1, val2); in convert_from_vtf_format()
135 static u32 convert_to_vtf_format(int size, int exp, int val1, int val2) in convert_to_vtf_format() argument
143 exp = hid_sensor_convert_exponent(exp); in convert_to_vtf_format()
144 if (exp < 0) { in convert_to_vtf_format()
145 divisor = int_pow(10, 6 + exp); in convert_to_vtf_format()
146 value = abs(val1) * int_pow(10, -exp); in convert_to_vtf_format()
149 divisor = int_pow(10, exp); in convert_to_vtf_format()
360 int scale1, int exp) in adjust_exponent_nano() argument
368 if (exp > 0) { in adjust_exponent_nano()
369 *val0 = scale0 * int_pow(10, exp); in adjust_exponent_nano()
371 if (exp > 9) { in adjust_exponent_nano()
375 for (i = 0; i < exp; ++i) { in adjust_exponent_nano()
378 res += int_pow(10, exp - 1 - i) * x; in adjust_exponent_nano()
382 *val1 = scale1 * int_pow(10, exp); in adjust_exponent_nano()
383 } else if (exp < 0) { in adjust_exponent_nano()
384 exp = abs(exp); in adjust_exponent_nano()
385 if (exp > 9) { in adjust_exponent_nano()
389 divisor = int_pow(10, exp); in adjust_exponent_nano()
393 for (i = 0; i < (9 - exp); ++i) { in adjust_exponent_nano()
396 res += int_pow(10, 8 - exp - i) * x; in adjust_exponent_nano()
399 *val1 = rem * int_pow(10, 9 - exp) + res; in adjust_exponent_nano()
411 int exp; in hid_sensor_format_scale() local
419 exp = hid_sensor_convert_exponent( in hid_sensor_format_scale()
423 unit_conversion[i].scale_val1, exp); in hid_sensor_format_scale()