I told my 13-year old girl that Julia has both rational and irrational types. How we started this conversation is a different story
As I showed off how it works in the REPL, she pointed out that it’s wrong to have
sqrt(2) not being an irrational type… common sense tells us that a number is either rational or irrational but cannot be neither.
I understand that a value can only has one type and it makes perfect sense to put it under
AbstractFloat. However, does this behavior bother anyone? Should rational/irrational really be a characteristic of a number a type rather than a type, hence we just have various supporting functions around them?
julia> sqrt(2) isa Irrational false julia> sqrt(2) isa Rational false julia> sqrt(2) isa Real true julia> sqrt(2) isa AbstractFloat true