A fun package for doing math with historic Mayan numerals.
Check out how Mayan numbers are made. The leftmost symbol represents the largest place value. In the decimal system, every place value is a multiple of ten times the previous value.
In the Mayan system, it is base 20, which means there are 19 symbols. Thus, every place value is twenty times more than the previous one. However, the third position is not 20 times larger than the last; it is 18. This is a special exception that makes this numeral system distinct.
julia> using MayanNumerals
julia> Mayan(0)
๐
julia> Mayan(1)
๐ก
julia> Mayan(3)
๐ฃ
julia> Mayan(5)
๐ฅ
julia> Mayan(8)
๐จ
julia> Mayan(14)
๐ฎ
julia> Mayan(20)
๐ก๐
julia> Mayan(100)
๐ฅ๐
julia> Mayan(369)
๐ก๐ ๐ฉ
julia> Mayan(359)
๐ฑ๐ณ
julia> Mayan(360)
๐ก๐ ๐
julia> Mayan(420)
๐ก๐ฃ๐
julia> Mayan(1024)
๐ข๐ฏ๐คYou can do math too!
julia> using MayanNumerals
julia> mayan"๐ก๐ญ๐ฒ" |> Int
638
julia> mayan"๐ก๐ญ๐ฒ" - mayan"๐ก๐ญ"
๐ก๐ฌ๐ฅ
julia> mayan"๐ก๐ญ๐ฒ" + mayan"๐ "
๐ก๐ญ๐ฒ
julia> mayan"๐ก๐ญ๐ฒ" + mayan"๐ฃ๐ ๐ "
๐ค๐ญ๐ฒ
julia> mayan"๐ก๐ญ๐ฒ" + mayan"๐ฃ๐ ๐ "
๐ค๐ญ๐ฒ