, 11 tweets, 2 min read
My Authors
Read all threads
The #julialang defines a number of standard constants and operators as Unicode symbols. Want to find out how to write mathy code? Continue reading this thread below.

🧵👇
Math constants and common functions:
π: pi constant
ℯ: Euler’s number
√: square root function
∛: cube root function
÷: integer division operator
⊻: XOR operator

2/11
Membership operators
∈: is in
∉: is not in
∋: contains
∌: does not contain
3/11
Comparison operators
≈: is approximately equals to
≉: is not approximately equals to
≠: does not equal
≡: is identical to
≢: is not identical to
≤: less than or equal to
≥: greater than or equal to
4/11
Set operators
∩: intersection of
∪: union of
⊆: is subset of
⊇: is superset of
⊈: is not subset of
⊉: is not superset of
⊊: is subset but not equal to
⊋: is superset but not equal to
5/11
Using Unicode can make the code look more concise. However, it takes more effort to enter Unicode symbols. The julia langugage manual has a great reference table for Unicode inputs. See docs.julialang.org/en/v1/manual/u…
6/11
Is it a good idea to use Unicode symbols in code? It think it depends on context. If the programmers are good with math then it is a godsend to be able to read/write code with Unicode. Remember: we need to consider not just the author but also future maintainers of the code.
7/11
Note that some fonts such as Fira Code or Cascadia support ligatures. So, even normal code can sometimes be displayed in Unicode anyways. For examples, ≠ and ≡ are displayed as Unicode for !== and === respectively.
8/11
The help mode can also display doc strings for these standard Unicode-symbol functions.
9/11
So how did I find out which Unicode symbols were defined in Base? It’s actually pretty straight forward.
10/11
I can’t believe you’ve come this far😄
Thank you for reading. I hope you learn something new today.
11/11
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Tom Kwong

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!