From 6a260ad9743ff1169b438beece0dca1ddd4906ae Mon Sep 17 00:00:00 2001 From: spaceface777 Date: Tue, 14 Jul 2020 19:26:14 +0200 Subject: [PATCH] doc: make int base section more concise (#5827) --- doc/docs.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index 6f99213d16..5d924b6924 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -26,6 +26,7 @@ you can do in V. * [Types](#types) * [Primitive types](#primitive-types) * [Strings](#strings) + * [Numbers](#numbers) * [Arrays](#arrays) * [Maps](#maps) * [Imports](#imports) @@ -39,10 +40,10 @@ you can do in V. * [Trailing struct literal syntax](#short-struct-initialization-syntax) * [Access modifiers](#access-modifiers) * [Methods](#methods) -* [println](#println) +* [println](#println) * [Functions 2](#functions-2) * [Pure functions by default](#pure-functions-by-default) * [Mutable arguments](#mutable-arguments) @@ -61,13 +62,13 @@ you can do in V. * [Testing](#testing) * [Memory management](#memory-management) * [ORM](#orm) + + + * [Writing documentation](#writing-documentation) * [Tools](#tools) * [vfmt](#vfmt) * [Profiling](#profiling) - - - * [Advanced](#advanced) * [Calling C functions from V](#calling-c-functions-from-v) * [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 type `int`. -You can also use hexadecimal notation for integer literals: +You can also use hexadecimal, binary or octal notation for integer literals: ```v a := 0x7B -``` -... or binary notation for integer literals: - -```v -a := 0b01111011 -``` -... or octal notation for specifying integer literals: - -```v -a := 0o173 +b := 0b01111011 +c := 0o173 ``` -All of these will assign the same value 123 to `a`. `a` will have the -type `int` no matter what notation you have used for the integer literal. +All of these will be assigned the same value, 123. They will all have type +`int`, no matter what notation you used. V also supports writing numbers with `_` as separator: