137
Forth (thelemmy.club)
you are viewing a single comment's thread
view the rest of the comments
[-] victorz@lemmy.world 5 points 1 week ago

The operand at the top of the stack is used as the second operand for binary operators. Second from the top is used as the first operand.

Here illustrated using dc, and doing the calculation 3 - 1 and printing the answer with the command p, getting the result of 2. As we can see here with a noncommutative operation (subtraction), in order to illustrate the point, we get 2, rather than -2.

~ dc
3 1 - p
2
this post was submitted on 10 Aug 2026
137 points (96.6% liked)

Programmer Humor

32824 readers
736 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS