1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: float exponential syntax (#10973)

This commit is contained in:
Lukas Neubert 2021-07-28 07:21:42 +02:00 committed by GitHub
parent 45ad48d76a
commit 64458c9308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -624,6 +624,13 @@ f2 := f32(3.14)
If you do not specify the type explicitly, by default float literals If you do not specify the type explicitly, by default float literals
will have the type of `f64`. will have the type of `f64`.
Float literals can also be declared as a power of ten:
```v
f0 := 42e1 // 420
f1 := 123e-2 // 1.23
f2 := 456e+2 // 45600
```
### Arrays ### Arrays
#### Basic Array Concepts #### Basic Array Concepts
Arrays are collections of data elements of the same type. They can be represented by Arrays are collections of data elements of the same type. They can be represented by