LogoLogo
  • V by Example
  • en
    • examples
      • section_3
        • Functions
        • Methods
        • Arrays
        • Struct
      • section_1
        • Primitives
        • Keywords
        • Variables
        • Formatted Print
        • Strings
        • Comments
      • section_4
        • Files
        • JSON
        • Testing
        • Array Functions
      • section_2
        • Operators
        • Looping Constructs
        • If statement
        • Match
  • V por exemplos
    • Contribuindo
    • examples
      • section_1
        • Comentários
        • Primitivos
        • Palavras-chave
      • section_2
        • Operadores
  • V mit einem Beispiel
    • examples
      • section_3
        • Methods
        • Struct
        • Functions
        • Arrays
      • section_4
        • Testing
        • Array Functions
        • JSON
        • Files
      • section_2
        • Looping Constructs
        • If statement
        • Match
        • Operators
      • section_1
        • Primitive Datentypen
        • Schlüsselwörter
        • Formatted Print
        • Strings
        • Kommentare
        • Variables
    • CONTRIBUTING_de
  • V dengan Contoh
    • examples
      • section1
        • Variabel
  • 通过例子学V语言
    • 例子
      • section_3
        • 函数
        • 方法
        • 数组
        • 结构体
      • section_1
        • 基本类型
        • 关键字
        • 变量
        • print系列函数
        • 字符
        • 注释
      • section_4
        • 文件
        • JSON操作
        • 调试
        • 数组函数
      • section_2
        • 运算符
        • 循环结构
        • If表达式
        • 匹配
  • コード例で学ぶV言語
    • examples
      • section_3
        • 関数
        • メソッド
        • 配列
        • 構造体
      • section_1
        • プリミティブ型
        • キーワード
        • 変数
        • 書式付き出力
        • 文字列
        • コメント
      • section_4
        • ファイル操作
        • JSON操作
        • テスト
        • 配列の関数
      • section_2
        • 演算子
        • ループ
        • If文
        • マッチ
  • Changelog
  • Contributing
  • Documentation Style Guide
Powered by GitBook
On this page
  • Grundlegende Typen
  • Komplexere Typen
  • Integer
  • Signed Integer
  • Unsigned Integer

Was this helpful?

  1. V mit einem Beispiel
  2. examples
  3. section_1

Primitive Datentypen

V hat weniger primitive Datentypen als Go.

Grundlegende Typen

  • bool: Wahrheitswert true oder false

  • string: eine Zeichenkette aus Bytes

  • int: numerischer Typ für ganze Zahlen

  • float numerischer Typ für Gleitkommazahlen.

  • rune: Unicode string, ein character literal

Komplexere Typen

  • array/[]: Eine Sammlung von Elementen des selben Typs (siehe Array).

  • map: Eine Sammlung von Schlüssel- und Wertpaaren { 'key' : value }

  • struct: Eine Datenstruktur zur Modellierung komplexerer Daten (siehe Structs).

Integer

Der Typ Integer kann weiterhin unterschieden werden in signed und unsigned. Signed bedeutet vorzeichenbehaftet, also positive und negative Werte der Variable sind möglich. Unsigned hingegen hat kein Vorzeichen, demnach kann der Wert nur eine positive Zahl sein.

Signed Integer

Type

Größe

Wertbereich

int8

8 bits

-128 bis 27 -1

int16

16 bits

-215 bis 215 - 1

int

32 bits

-231 bis 231 - 1

int64

64 bits

-263 bis 263 - 1

int128

128 bits

-2127 bis 2127 - 1

Unsigned Integer

Type

Size

Wertbereich

byte

8 bits

0 bis 27 -1

u16

16 bits

0 bis 215 - 1

u32

32 bits

0 bis 231 - 1

u64

64 bits

0 bis 263 - 1

u128

128 bits

0 bis 2127 - 1

Previoussection_1NextSchlüsselwörter

Last updated 5 years ago

Was this helpful?