Input a scientific notation number (base 10), output scientific notation in base 16 (as defined below).
Details
In scientific notation, all non-zero numbers are written in the form
$$ m \times 10^n $$
Where \$ n \$ is an integer, and \$ m \$ is a real number, \$ 1 \leq |m| < 10 \$.
Consider scientific notation in base 16.
$$ m \times 10^n = m' \times 16^{n'} $$
\$ n' \$ is an integer, and \$ m' \$ is a real number where \$ 1 \leq |m'| < 16 \$.
Input / Output
Input a positive real number. You may also choice to input \$m\$, and, \$n\$ separately. For all testcase, -100 < n < 100.
Output the number in hexadecimal scientific notation. Could be a single string or two strings. Number \$m\$, and, \$n\$ should also be formatted as hexadecimal strings.
Output as 1.2E3E4
is not allowed due to ambiguous. (1.2E3×104, or 1.2×103E4) You have to use other notations. For example, 1.2E3E+4
, 1.2E3, 4
, 1.2E3&4
, 1.2e3E4
, 1.2E3e4
, 1.2E3P4
, 1.2E3⏨4
, 1.2E3*^4
are all acceptable.
Testcases
m, n -> m', n'
1.6, 1 -> 1, 1
6.25, -2 -> 1, -1
1.0, 1 -> A, 0
7.257672195146994, 93 -> d.eadbeef, 4d
1.234567, 89 -> f.83e0c1c37ba7, 49
1, -99 -> 8.bfbea76c619f, -53
You output may be slightly different from given testcase due to floating point errors. But you should keep at least 4 hex digits precision, and \$1 \leq m' < 16\$.
Rule
This is code golf. Shortest codes in each languages win.
1.2E3E4
, the digitE
and the exponential separator have the same case. \$\endgroup\$