You are on page 1of 1

FORMAT SPECIFIERS MATH FUNCTION

SPECIFIER USED FOR FUNCTION DESCRIPTION


%c A single character sqrt() To find the square root of a number
%s A string ceil() Rounds a number upwards to its nearest integer
%hi Short (signed) floor() Rounds a number downwards to its nearest integer
%hu Short (unsigned) pow() Returns the value of x to the power of y (xy)
%Lf Long double abs(x) Returns the absolute value of x
%n Prints nothing acos(x) Returns the arccosine of x
%d A decimal integer (assumes base 10) asin(x) Returns the arcsine of x
%i A decimal integer (detects the base automatically) atan(x) Returns the arctangent of x
%o An octal (base 8) integer cbrt(x) Returns the cube root of x
%x A hexadecimal (base 16) integer cos(x) Returns the cosine of x
%p An address (or pointer) exp(x) Returns the value of Ex
%f A floating-point number for floats sin(x) Returns the sine of x (x is in radians)
%u Int unsigned decimal tan(x) Returns the tangent of an angle
%e A floating-point number in scientific notation
%E A floating-point number in scientific notation
%% The % symbol

You might also like