Artihmetic

Smojo has two kinds of numbers, integers and reals. Integers represent whole numbers, including negative numbers. Reals represent both whole and fractional numbers.

For performance reasons, Smojo has a separate version of arithmetic words for integers and reals:
WordAction
+ - * / =

Used to operate between integers only. If a real number is encountered, it is truncated -- fractional part is discarded. For example, 
1 2 +
will give 3 as expected, but
1 2.8 +
will also give 3, since 2.8 is truncated. The equal sign is used to test if two integers on the stack are equal.

+. -. *. /. =.

As above, but these can operate on real numbers. No truncation is performed.

> >= < <=

Inequality tests. These work on both integers and reals. The result is a boolean (TRUE/FALSE) on the stack.

1 2.2 < . 
displays
true ok

Examples

	2 3 / . 
	0 ok

	2 3 /. . 
	0.6666666666666666 ok

	1 0.1 / 
	ERROR: / by zero

	1 2.1 / . 
	0 ok

	2.9 1 / . 
	2 ok

	1 2 = . 
	false ok
	

Quiz

Do you understand the examples above? Can you explain why the program:

		1 2.1 / . 
		
results in 0 being displayed as the answer rather than 0.4761904762, which is what you would have expected with a calculator? What changes would you make to obtain the desired answer?



Next: Modes