language · language ·

Arithmetic, comparison, and bit operators

Scalar expressions use explicit arithmetic, comparison, bitwise, shift, and unary operators with ordinary precedence.

!=&*+-/<<<<===>>=>>^arithmeticcpulanguagelogicyeho|~

Use parentheses when domain meaning is more important than remembering the precedence table.

left + right
left == right
bits << amount
~bits

Status: stable

Calculate a critical hit

Combine integer damage arithmetic with a boolean threshold.

cpu · arithmetic · executed

int baseDamage = 40
int multiplier = 150
int damage = (baseDamage * multiplier) / 100
bool critical = damage >= 50
Console.Log(Text.Format("Damage {0}; critical {1}", damage, critical))
project.mech
manifestVersion = "2"
package = "api.example.language__operators"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"
Expected output
Damage 60; critical true
Notes and source

Operator overloading is unavailable.

Compound assignments such as += and ++ are unavailable. Write value = value + 1.

yeho/parser_expressions.cpp precedence functions; conformance expressions.scalar