HyperMath

Arithmetic Expressions

Arithmetic Expressions

Previous topic Next topic No expanding text in this topic  

Arithmetic Expressions

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

HyperMath has the usual binary arithmetic operators.

> print(2+3, 5-12, 2*7, 7/8)

5       -7      14      0.875

 

> print(5*(2-8.3)/77.7+99.1)

98.694594594595

 

> print("The number is", 5*(2-8.3)/77.7+99.1)

The number is   98.694594594595

 

> print(StrFormat("%8.4f",5*(2-8.3)/77.7+99.1))

98.6946

Unary negation:

> print(-(-10), -(10))

10      -10

Power of:

> print(7^2, 107^0, 2^8)

49      1       256

NoteHyperMath uses right-associativity for the power operator.  So, a^b^c is resolved as a^(b^c).