Skip to content

Instantly share code, notes, and snippets.

@drmingle
Created May 5, 2018 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drmingle/e21cc394308235aa1418a25ff8fadb69 to your computer and use it in GitHub Desktop.
Save drmingle/e21cc394308235aa1418a25ff8fadb69 to your computer and use it in GitHub Desktop.
title author date
Arithmetic Essentials
Damian Mingle
05/05/2018

Assign values to variables

a = 11
b = 7

a plus b

a + b
18

a minus b

a - b
4

a times b

a * b
77

The remainder of a divided by b

a % b
4

a divided by b

a / b
1.5714285714285714

a divided by b (the quotient)

a // b
1

a raised to the b power

a ** b
19487171

a plus b, then divide by a

(a + b) / a
1.6363636363636365

Comparing: Division Methods

Classic divison of 4 by 7

4 / 7
0.5714285714285714

Floor divison of 4 by 7

# This is a simple truncation of any remainder
4 // 7
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment