Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dc (computer program)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Conditionals=== Finally, we can use this macro mechanism to provide conditionals. The command <code>=r</code> pops two values from the stack, and executes the macro stored in register <code>r</code> only if they are equal. So this prints the string <code>equal</code> only if the top two values on the stack are of equal value: <pre> [[equal]p] sr 5 5 =r </pre> Other conditionals are <code>></code>, <code>!></code>, <code><</code>, <code>!<</code>, <code>!=</code>, which execute the specified macro if the top two values on the stack are greater, less than or equal to ("not greater"), less than, greater than or equal to ("not less than"), and not equals, respectively. Note that the order of the operands in inequality comparisons is the opposite of the order for arithmetic; {{kbd|5 3 -}} evaluates to {{code|5 - 3 {{=}} 2}}, but {{kbd|5 3 <t}} runs the contents of the {{kbd|t}} register because {{code|3 < 5}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)