Decimal literals are decimal values written directly in the program text.
There are two notations for writing decimals.
In general, if the sign is omitted, it is assumed to be +
. Both a +
and a -
can be used.
There can be at most 15 decimal digits. If there are more than 15 digits, the number is rounded to 15 digits.
If there is a decimal point, there needs to be at least one digit before and after. The decimal point can be placed between any of the digits. The decimal point can also be placed first with a preceeding zero.
For example: -3
or 8.314462618
.
Parts:
For example -1e12
or 6.67408e-11
.
Parts:
e
, after which comes the exponentWe would be more than happy to help you. Our opening hours are 9–15 (CET).
📞 (+47) 93 68 22 77
Nils Bays vei 50, 0876 Oslo, Norway