Decimal and Hexadecimal exponent in Swift

For decimal numbers with exponent value (e), the given number is multiplied by 10 to the power of exp.

For hexadecimal numbers with exponent value (p), the given number is multiplied by 2 to the power of exp.

Example:

var decimalExponent = 25.5e3

var hexadecimalExponent = 0x345p-4

Leave a Reply