1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: improve checking of a << b, when a and b are numbers (#12589)

This commit is contained in:
Delyan Angelov
2021-11-29 02:48:49 +02:00
committed by GitHub
parent fe37da31a8
commit 6d97b0a407
33 changed files with 436 additions and 148 deletions

View File

@ -11,9 +11,9 @@ const (
mask = 0x7FF
shift = 64 - 11 - 1
bias = 1023
normalize_smallest_mask = (u64(1) << 52)
sign_mask = (u64(1) << 63)
frac_mask = ((u64(1) << u64(shift)) - u64(1))
normalize_smallest_mask = u64(u64(1) << 52)
sign_mask = u64(0x8000000000000000) // (u64(1) << 63)
frac_mask = u64((u64(1) << u64(shift)) - u64(1))
)
// inf returns positive infinity if sign >= 0, negative infinity if sign < 0.