# Mayan Numerals in Julia - MayanNumerals.jl

**URL:** https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140
**Category:** Package Announcements
**Created:** [November 1, 2024, 3:03pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140 "2024-11-01T15:03:16Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![inokawazu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inokawazu/32/25347_2.png) [@inokawazu](https://discourse.julialang.org/u/inokawazu)
#### Post date: [November 1, 2024, 3:03pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/1 "2024-11-01T15:03:16Z")

</div>

I was watched this [yt video](https://www.youtube.com/watch?v=Q4-C7NkqpME). Seemed in interesting so I thought I would make a package for using Mayan numerals since Julia has Unicode support and what not. Here is [the package (MayanNumerals.jl)](https://github.com/inokawazu/MayanNumerals.jl).

---

<div class="post-metadata">

### Author: ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)
#### Post date: [November 1, 2024, 4:28pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/2 "2024-11-01T16:28:55Z")

</div>

The github readme doesn’t do your work justice 😀

```julia
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)
𝋢𝋯𝋤

```

---

<div class="post-metadata">

### Author: ![inokawazu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inokawazu/32/25347_2.png) [@inokawazu](https://discourse.julialang.org/u/inokawazu)
#### Post date: [November 1, 2024, 9:21pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/3 "2024-11-01T21:21:27Z")

</div>

I didn’t even think of people not having the font installed. Oops! I wonder if there is a way to check if the user has the right font to render the glyphs (not much help in the readme though).

---

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [November 1, 2024, 9:37pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/4 "2024-11-01T21:37:26Z")

</div>

How do you do numbers less than one?  
What is Pi in Mayan number system???  
What about negative and imaginary numbers?

---

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [November 1, 2024, 9:40pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/5 "2024-11-01T21:40:41Z")

</div>

You don’t need fonts, just use an array of Ints  
Are you going to use Big Mayan Indians or Small Mayan Indians for your array?

---

<div class="post-metadata">

### Author: ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)
#### Post date: [November 1, 2024, 11:00pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/6 "2024-11-01T23:00:28Z")

</div>

You might like my [AncientNumbers.jl](https://github.com/mcabbott/AncientNumbers.jl), which supports calculations like `XV + 𒐝 - ䷀ == 𐏔𐏒𐏑`… but no Mayan. (Maybe becaue `𝋠` doesn’t parse as in Julia?)

---

<div class="post-metadata">

### Author: ![inokawazu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inokawazu/32/25347_2.png) [@inokawazu](https://discourse.julialang.org/u/inokawazu)
#### Post date: [November 2, 2024, 1:35am UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/7 "2024-11-02T01:35:13Z")

</div>

I did absolutely consider it to have negative and decimal. I decided against it because it would have been a bit anachronistic. Technically, the numeral system is base 20 where on the 3rd (1st being the ones place) base is different.

---

<div class="post-metadata">

### Author: ![inokawazu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inokawazu/32/25347_2.png) [@inokawazu](https://discourse.julialang.org/u/inokawazu)
#### Post date: [November 2, 2024, 1:36am UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/8 "2024-11-02T01:36:13Z")

</div>

I did consider using an array of Ints, but decided to make the Mayan number a think wrapper around an Int type since it makes it easier to implement arithmetic.

---

<div class="post-metadata">

### Author: ![inokawazu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/inokawazu/32/25347_2.png) [@inokawazu](https://discourse.julialang.org/u/inokawazu)
#### Post date: [November 2, 2024, 1:39am UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/9 "2024-11-02T01:39:02Z")

</div>

Wow great package! I’ll have to check it out! The interesting about the Mayan Unicode codepoints is that Julia does recognize them as numerals since `isnumeric('𝋠') == true`.

---

<div class="post-metadata">

### Author: ![caleb-allen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/caleb-allen/32/14054_2.png) [@caleb-allen](https://discourse.julialang.org/u/caleb-allen)
#### Post date: [November 4, 2024, 12:07pm UTC](https://discourse.julialang.org/t/mayan-numerals-in-julia-mayannumerals-jl/122140/10 "2024-11-04T12:07:16Z")

</div>

I’ve recently been dealing with a shady merchant who sent me a bad delivery, finally I can calculate the refund I’m owed for the adjusted value of this pile of low-grade copper (not to mention the terrible customer service my employee had to deal with)
