Jump to content

Literals/Floating point: Difference between revisions

→‎{{header|Go}}: Float literal may start with dot
(→‎{{header|Factor}}: clarify the base 2 exponents)
(→‎{{header|Go}}: Float literal may start with dot)
Line 446:
 
=={{header|Go}}==
See [http://golang.org/doc/go_spec.html#Floating-point_literals relevant section] of language reference. Basically they are base 10, need either a decimal point or an exponent, and specify no precision or representation. The exponent can be signed, but the mantissa is not. One of the integer part or the fractional part may be elided; one of the decimal point or the exponent may be elided. A leading minus sign would be an operator and not part of the floating point literal. Examples,
<pre>0.
0.0
.0
1e3
1e-300
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.