mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
move below max_i64
This commit is contained in:
parent
827b0a8e23
commit
c95f876b68
1 changed files with 3 additions and 3 deletions
|
@ -42,15 +42,15 @@ pub const max_i16 = i16(32767)
|
||||||
pub const min_i32 = i32(-2147483648)
|
pub const min_i32 = i32(-2147483648)
|
||||||
pub const max_i32 = i32(2147483647)
|
pub const max_i32 = i32(2147483647)
|
||||||
|
|
||||||
pub const min_int = $if new_int ? { int(min_i64) } $else { int(min_i32) }
|
|
||||||
pub const max_int = $if new_int ? { int(max_i64) } $else { int(max_i32) }
|
|
||||||
|
|
||||||
// -9223372036854775808 is wrong, because C compilers parse literal values
|
// -9223372036854775808 is wrong, because C compilers parse literal values
|
||||||
// without sign first, and 9223372036854775808 overflows i64, hence the
|
// without sign first, and 9223372036854775808 overflows i64, hence the
|
||||||
// consecutive subtraction by 1
|
// consecutive subtraction by 1
|
||||||
pub const min_i64 = i64(-9223372036854775807 - 1)
|
pub const min_i64 = i64(-9223372036854775807 - 1)
|
||||||
pub const max_i64 = i64(9223372036854775807)
|
pub const max_i64 = i64(9223372036854775807)
|
||||||
|
|
||||||
|
pub const min_int = $if new_int ? { int(min_i64) } $else { int(min_i32) }
|
||||||
|
pub const max_int = $if new_int ? { int(max_i64) } $else { int(max_i32) }
|
||||||
|
|
||||||
pub const min_u8 = u8(0)
|
pub const min_u8 = u8(0)
|
||||||
pub const max_u8 = u8(255)
|
pub const max_u8 = u8(255)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue