doc: make int base section more concise (#5827)

pull/5825/head
spaceface777 2020-07-14 19:26:14 +02:00 committed by GitHub
parent f5579525c4
commit 6a260ad974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 17 deletions

View File

@ -26,6 +26,7 @@ you can do in V.
* [Types](#types) * [Types](#types)
* [Primitive types](#primitive-types) * [Primitive types](#primitive-types)
* [Strings](#strings) * [Strings](#strings)
* [Numbers](#numbers)
* [Arrays](#arrays) * [Arrays](#arrays)
* [Maps](#maps) * [Maps](#maps)
* [Imports](#imports) * [Imports](#imports)
@ -39,10 +40,10 @@ you can do in V.
* [Trailing struct literal syntax](#short-struct-initialization-syntax) * [Trailing struct literal syntax](#short-struct-initialization-syntax)
* [Access modifiers](#access-modifiers) * [Access modifiers](#access-modifiers)
* [Methods](#methods) * [Methods](#methods)
* [println](#println)
</td><td width=33% valign=top> </td><td width=33% valign=top>
* [println](#println)
* [Functions 2](#functions-2) * [Functions 2](#functions-2)
* [Pure functions by default](#pure-functions-by-default) * [Pure functions by default](#pure-functions-by-default)
* [Mutable arguments](#mutable-arguments) * [Mutable arguments](#mutable-arguments)
@ -61,13 +62,13 @@ you can do in V.
* [Testing](#testing) * [Testing](#testing)
* [Memory management](#memory-management) * [Memory management](#memory-management)
* [ORM](#orm) * [ORM](#orm)
</td><td valign=top>
* [Writing documentation](#writing-documentation) * [Writing documentation](#writing-documentation)
* [Tools](#tools) * [Tools](#tools)
* [vfmt](#vfmt) * [vfmt](#vfmt)
* [Profiling](#profiling) * [Profiling](#profiling)
</td><td valign=top>
* [Advanced](#advanced) * [Advanced](#advanced)
* [Calling C functions from V](#calling-c-functions-from-v) * [Calling C functions from V](#calling-c-functions-from-v)
* [Debugging generated C code](#debugging-generated-c-code) * [Debugging generated C code](#debugging-generated-c-code)
@ -394,24 +395,16 @@ a := 123
This will assign the value of 123 to `a`. By default `a` will have the This will assign the value of 123 to `a`. By default `a` will have the
type `int`. type `int`.
You can also use hexadecimal notation for integer literals: You can also use hexadecimal, binary or octal notation for integer literals:
```v ```v
a := 0x7B a := 0x7B
``` b := 0b01111011
... or binary notation for integer literals: c := 0o173
```v
a := 0b01111011
```
... or octal notation for specifying integer literals:
```v
a := 0o173
``` ```
All of these will assign the same value 123 to `a`. `a` will have the All of these will be assigned the same value, 123. They will all have type
type `int` no matter what notation you have used for the integer literal. `int`, no matter what notation you used.
V also supports writing numbers with `_` as separator: V also supports writing numbers with `_` as separator: