A most harrowing collection of Julia WATs

miguelraz
Wed, 02 Mar 2022 18:15:32 +0000
General Usage

Hello all!
I’ve been collecting a few of the most cursed corner cases of Julia WATs that I know of here (WIP), but I would appreciate if people could share their own rare specimens as well.

Please ping me with your contributions and I’ll post with proper credit.

Here’s an example of what I mean by a Julia WAT:

julia> e = 9998.0
9998.0

julia> 2e
19996.0

julia> 2e+4
20000.0

julia> 2e+5 # This should be 20001.0, right?
200000.0

julia> 2e + 5 # note the spacing
20001.0

…wat.

Some of these are just unavoidable corner cases of multiple design constraints, others are an artifact of parsing being hard, but they’re all supposed to be tongue-in-cheek puzzles of our dear JuliaLang <3.

109 posts - 51 participants