v
v copied to clipboard
[Bug] `println` refuses to print large number
What did you do?
module main
fn main () {
println(i64(0x8000000000000000))
}
What did you expect to see?
-9223372036854775808
What did you see instead?
Literally nothing
Additional Info
- No warnings / errors when executing with
v run Test.vnorv Test.v && ./Test - Tested against
Weekly V 0.2.2 7664964andStable V 0.2.2 46cdf4f - Using
Ubuntu 20.04.2 LTS -> Kernel: 5.8.0-48-lowlatency - Possibly related to #3751 (Although this bug persists even when executing a successfully compiled binary)
I'm not a fan of vlang, I found this issue in VLang Memes (wip), so I don't known if vlang compiles also to LLVM Bitcode, anyway the problem is linked to native version of binary, it seems to work "perfectly" (I don't know what the correct output should be) in playground with wasm interpreter (executed in msedge)

EDIT: ah okay with "LLVM" he meant that the c code in output was compiled with clang... mhh so you could try to compile it with gcc if not already done
Apparently, you've just discovered a new/related bug: Playground seems to be broken as well, probably even more than native v. Haven't checked on Windows, but this doesn't look promising...
These should be the correct results:
int(0xffffffff) == -1
i64(0x8000000000000000) == -9223372036854775808
Firefox

Actual V (0.3.2):
module main
fn main() {
println(i64(0x8000000000000000) == -9223372036854775808)
}
true
Fixed