Skip to content

Commit

Permalink
Merge pull request #171 from moonbitlang/basic-types
Browse files Browse the repository at this point in the history
add more description for basic types
  • Loading branch information
bobzhang authored Mar 31, 2024
2 parents c917cb6 + 6f2ee65 commit 7e66114
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,15 @@ fn init {

### Number

MoonBit supports numeric literals, including decimal, binary, octal, and hexadecimal numbers.
MoonBit have integer type and floating point type:

|type|description|
|-|-|
|`Int`|32-bit signed integer|
|`Int64`|64-bit signed integer|
|`Double`|64-bit floating point, defined by IEEE754|

MoonBit also supports numeric literals, including decimal, binary, octal, and hexadecimal numbers.

To improve readability, you may place underscores in the middle of numeric literals such as `1_000_000`. Note that underscores can be placed anywhere within a number, not just every three digits.

Expand Down
10 changes: 9 additions & 1 deletion zh-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,15 @@ fn init {

### 数字

Moonbit 支持的数字字面量,包括十进制、二进制、八进制和十六进制。
MoonBit 支持整型和浮点类型:

|类型|描述|
|-|-|
|`Int`|32位有符号整数|
|`Int64`|64位有符号整数|
|`Double`|64位浮点数,由IEEE754定义|

MoonBit 支持的数字字面量,包括十进制、二进制、八进制和十六进制。

为了提升可读性,你可以在数字字面量内插入下划线,例如 `1_000_000`
注意,下划线可以插入到数字之间的任何位置,而非只能在每三个数字之间。
Expand Down

0 comments on commit 7e66114

Please sign in to comment.