Uiua: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 31: Line 31:
== Primitives ==
== Primitives ==
=== Function ===
=== Function ===
In the web version of Uiua, we can type in the name of the function or a part of it and when run, the interpreter will format the name to Unicode Symbol, so that we don't need use of non-ASCII keyboards.
==== Stack ====
==== Stack ====
Work with the stack
Work with the stack
Line 38: Line 39:
! Glyph !! Name !! Type !! Definition
! Glyph !! Name !! Type !! Definition
|-
|-
| <code>.</code> || Duplicate || Monadic 2-output function || Duplicate the top value on the stack
| <code>.</code> || [[Duplicate]] || Monadic 2-output function || Duplicate the top value on the stack
|-
|-
| <code>,</code> || Over || Dyadic 3-output function || Duplicate the second-to-top value to the top of the stack  
| <code>,</code> || [[Over]]|| Dyadic 3-output function || Duplicate the second-to-top value to the top of the stack  
|-
|-
| <code>:</code> || Flip || Dyadic 2-output function || Swap the top two values on the stack  
| <code>:</code> || [[Flip]] || Dyadic 2-output function || Swap the top two values on the stack  
|-
|-
| <code>◌(;)</code> || Pop ||Monadic 0-output function || Discard the top stack value
| <code>◌(;)</code> || [[Pop]] ||Monadic 0-output function || Discard the top stack value
|-
|-
| <code>?</code> || Stack || Noadic 0-output function || Debug print all stack values without popping them
| <code>?</code> || [[Stack]] || Noadic 0-output function || Debug print all stack values without popping them
|-
|-
| <code>⸮</code> || Trace || Monadic function || Debug print the top value on the stack without popping it
| <code>⸮</code> || [[Trace]] || Monadic function || Debug print the top value on the stack without popping it
|-
|-
|}
|}
Line 57: Line 58:
!Glyph !! Name !! Definition
!Glyph !! Name !! Definition
|-
|-
| <code>η</code> || Eta || The number of radians in a quarter circle
| <code>η</code> || [[Eta]] || The number of radians in a quarter circle
|-
|-
| <code>π</code> || Pi || The ratio of a circle's circumference to its diameter
| <code>π</code> || [[Pi]] || The ratio of a circle's circumference to its diameter
|-
|-
| <code>τ</code> || Tau || The ratio of a circle's circumference to its radius
| <code>τ</code> || [[Tau]] || The ratio of a circle's circumference to its radius
|-
|-
| <code>∞</code> || Infinity || The biggest number
| <code>∞</code> || [[Infinity]] || The biggest number
|}
|}
==== Monadic Pervasive ====
==== Monadic Pervasive ====
Line 71: Line 72:
! Glyph !! Name !! Definition
! Glyph !! Name !! Definition
|-
|-
| <code>¬</code> || Not || Logical not
| <code>¬</code> || [[Not]] || Logical not
|-
|-
| <code>±</code> || Sign || Numerical sign (1, ¯1, or 0)
| <code>±</code> || [[Sign]] || Numerical sign (1, ¯1, or 0)
|-
|-
| <code>¯</code> || Negate || Negate a number
| <code>¯</code> || [[Negate]] || Negate a number
|-
|-
| <code>⌵</code> || Absolute value || Get the absolute value of a number
| <code>⌵</code> || [[Absolute value]] || Get the absolute value of a number
|-
|-
| <code>√</code> || Sqrt || Take the square root of a number
| <code>√</code> || [[Sqrt]] || Take the square root of a number
|-
|-
| <code>○</code> || Sine || Get the sine of a number
| <code>○</code> || [[Sine]] || Get the sine of a number
|-
|-
| <code>⌊</code> || Floor || Round to the nearest integer towards <code>¯∞</code>
| <code>⌊</code> || [[Floor]] || Round to the nearest integer towards <code>¯∞</code>
|-
|-
| <code>⌈</code> || Ceiling || Round to the nearest integer towards <code>∞</code>
| <code>⌈</code> || [[Ceiling]] || Round to the nearest integer towards <code>∞</code>
|-
|-
| <code>⁅</code> || Round || Round to the nearest integer
| <code>⁅</code> || [[Round]] || Round to the nearest integer
|}
|}
==== Dyadic Pervasive ====
==== Dyadic Pervasive ====
Line 93: Line 94:
{| class="wikitable" style="margin:auto"
{| class="wikitable" style="margin:auto"
|+ Table of Monadic Pervasive in Uiua
|+ Table of Monadic Pervasive in Uiua
! Glyph !! Name !! Definition
! Glyph !! Name !! Definition !! Formats from:
|-
| <code>=</code> || [[Equals]] || Compare for equality || =
|-
| <code>≠</code> || [[Not equals]] || Compare for inequality || !=
|-
| <code><</code> || [[Less than]] || Compare for less than || <
|-
| <code>></code> || [[Greater than]] || Compare for greater than || >
|-
| <code>≤</code> || [[Less or equal]] || Compare for less than or equal || <=
|-
| <code>≥</code> || [[Greater or equal]] || Compare for greater than or equal || >=
|-
| <code>+<</code> || [[Add]] || Add values || +
|-
| <code>-</code> || [[Subtract]] || Subtract values || -
|-
| <code>×</code> || [[Multiply]] || Multiply values || *
|-
|-
| <code>=</code> || Equals || Compare for equality
| <code>
|}
|}
== External links ==
== External links ==
19

edits

Navigation menu