asomiya 0.2.0

Control flow

Operators

Operators work the same way as in most languages. Only the words আৰু (and) and বা (or) are in Assamese.

Arithmetic

OperatorMeaningExample
+add (or join text)২ + ৩ → ৫
-subtract৯ - ৪ → ৫
*multiply৬ * ৭ → ৪২
/divide৭ / ২ → ৩.৫
%remainder৭ % ২ → ১
কোৱা(২ + ৩ * ৪)
কোৱা((২ + ৩) * ৪)
Output
১৪
২০
kowa(2 + 3 * 4)
kowa((2 + 3) * 4)
Output
14
20

Dividing by zero is an error (R004), not infinity.

Comparison

==, !=, <, <=, >, >= compare values and give সঁচা or মিছা. == works on any two values; the others need two numbers or two texts.

কোৱা(৫ > ৩, ৫ == ৫.০, "ক" != "খ")
Output
সঁচা সঁচা সঁচা
kowa(5 > 3, 5 == 5.0, "k" != "kh")
Output
xosa xosa xosa

Logic

AssameseEnglish lettersSymbolMeaning
আৰুaru&&both are true
বাba||at least one is true
!not
ধৰা বয়স = ২০
কোৱা(বয়স >= ১৮ আৰু বয়স < ৬০)
কোৱা(!(বয়স > ১০))
Output
সঁচা
মিছা
dhora boyox = 20
kowa(boyox >= 18 aru boyox < 60)
kowa(!(boyox > 10))
Output
xosa
misa

আৰু and বা stop early: if the left side already decides the answer, the right side isn’t evaluated.

Precedence

From strongest to weakest:

  1. ! and unary -
  2. * / %
  3. + -
  4. < <= > >=
  5. == !=
  6. আৰু
  7. বা
  8. =

When in doubt, use brackets.