Skip to content

Commit

Permalink
add docs for float and bigint (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoorkin authored Aug 19, 2024
1 parent dfacac8 commit 04f411a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions moonbit-docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ MoonBit have integer type and floating point type:
| `UInt` | 32-bit unsigned integer | `14U` |
| `UInt64` | 64-bit unsigned integer | `14UL` |
| `Double` | 64-bit floating point, defined by IEEE754 | `3.14` |
| `Float` | 32-bit floating point | `(3.14 : Float)` |
| `BigInt` | represents numeric values larger than other types | `10000000000000000000000N` |

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

Expand Down Expand Up @@ -646,6 +648,8 @@ let int : Int = 42
let uint : UInt = 42
let int64 : Int64 = 42
let double : Double = 42
let float : Float = 42
let bigint : BigInt = 42
```

### String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ MoonBit 支持整型和浮点类型:
| `UInt` | 32 位无符号整数 | `14U` |
| `UInt64` | 64 位无符号整数 | `14UL` |
| `Double` | 64 位浮点数,由 IEEE754 定义 | `3.14` |
| `Float` | 32 位单精度浮点数 | `(3.14 : Float)` |
| `BigInt` | 表示任意大的整数 | `10000000000000000000000N` |

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

Expand Down Expand Up @@ -630,6 +632,8 @@ let int : Int = 42
let uint : UInt = 42
let int64 : Int64 = 42
let double : Double = 42
let float : Float = 42
let bigint : BigInt = 42
```

### 字符串
Expand Down

0 comments on commit 04f411a

Please sign in to comment.