Exponential notation (aka 'Scientific' notation) represents a numeric value as mantissa and exponent. The mantissa is value in the interval [1, 10) in decimal notation. This notation is convenient for numbers with many digits (really really small fractions or larger numbers). printf only prints floats or doubles in exponential notation, as
/* Would print 4.200000e01 */
float x = 42.0;
printf("%e", x);
In reprint, exponential notation is not bound to the type of input; it is simply a method of output. Both integers and floating point values can be represented in exponential notation:
/* Print 4.200000e1 */
float x = 42.0;
reprint("\f.fr", x);
/* Print 4.200000e1 */
int y = 42;
reprintf("\f.r", y);
Printing integers in exponential notation may seem silly, but it's perfectly valid from a mathematical standpoint. If you are dealing with very large noisy counters, then exponential notation could neaten their appearance.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.