Arithmetic operators (guide)

Help Contents Logo and Mathematics Mathematical operators Arithmetic operators (guide)
Mathematical operators Integer arithmetic operators (idiv, imod)

Arithmetic operators (guide)

+, -, *, /, ^

The first thing that Logo learns after executing run "logo, is a number of very important operators, which it can use to build mathematical expressions.

The operator + is used to add numbers, - is to subtract, * is to multiply, / is to divide, and finally, ^ is for calculating powers.

The following examples demonstrate how you can use these operators:
	print 2 + 4 ; 6
	print 2 - 4 ; -2
	print 2 * 4 ; 8
	print 2 / 4 ; 0.5
	print 2 ^ 4 ; 16
	print 2^3 + 3*4 ; 20

Mathematical operators Integer arithmetic operators (idiv, imod)