Modulus Operator

Description

The code a % b returns the remainder of $a$ divided by $b$.

Sage Cell

Code

a =14
b = 3
r = a % b
r

Options

none

Tags

Primary Tags—Programming: The Python Language; Arithmetic: Integers; Number Theory: Congruences.

Secondary Tags—The Python Language: Expressions and operators, Numeric operations;
Integers: Division;
Congruences: Modular Arithmetic.

Related Cells

Attribute

Permalink: http://abstract.ups.edu/aata/integers-sage.html

Author: R. Beezer

Date: 14 Jul 2017 10:23

Submitted by: Tom Judson

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License