> For the complete documentation index, see [llms.txt](https://v-community.gitbook.io/v-by-example/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v-community.gitbook.io/v-by-example/cn/examples/section_1/primitives.md).

# 基本类型

V的基本类型比Go少。

## 基本数据类型

* bool 也就是 `true` 或者 `false`
* string 字符类型
* 整数类型 `int`
* 浮点数类型 `float`
* rune (Unicode字符串)

## 复合类型

* arrays `[]`
* map `{}`
* struct

## 整数

整数被细分为“signed”和“unsigned”。`signed`表示正或负，`unsigned`仅表示正。

### Signed Integer

| 类型     |    大小    |                范围 |
| ------ | :------: | ----------------: |
| int8   |  8 bits  |     -128 to 27 -1 |
| int16  |  16 bits |   -215 to 215 - 1 |
| int    |  32 bits |   -231 to 231 - 1 |
| int64  |  64 bits |   -263 to 263 - 1 |
| int128 | 128 bits | -2127 to 2127 - 1 |

### Unsigned Integer

| 类型   |    大小    |            范围 |
| ---- | :------: | ------------: |
| byte |  8 bits  |    0 to 27 -1 |
| u16  |  16 bits |  0 to 215 - 1 |
| u32  |  32 bits |  0 to 231 - 1 |
| u64  |  64 bits |  0 to 263 - 1 |
| u128 | 128 bits | 0 to 2127 - 1 |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v-community.gitbook.io/v-by-example/cn/examples/section_1/primitives.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
