Literals/Floating point: Difference between revisions
→{{header|Kotlin}}
Jazzedpineda (talk | contribs) (Added EasyLang implementation) |
|||
Line 797:
=={{header|Kotlin}}==
There are two floating point types: Double (64 bits) and Float (32 bits). The default floating point type is Double.
<syntaxhighlight lang="scala">val d: Double = 1.0▼
val d2: Double = 1.234e-10▼
Double literals must end with a decimal point with at least one digit after it, and/or a scientific notation suffix made with <code>e</code> (or <code>E</code>) followed by an integer literal.
val f: Float = 728832f▼
val f2: Float = 728832F</syntaxhighlight>▼
A Float literal is made by appending <code>f</code> (or <code>F</code>) to a Double or Int literal (see [[Literals/Integer#Kotlin|integer literals]]).
val d = 1.0 // Double
val f2 = 7.28832e5F // Float
=={{header|Lasso}}==
|