Basic Mathematical Operations
Description
In additional to +, -, *, and /, Sage uses ^ or ** for exponentiation, // for integer division, and % for mod; i.e., remainder.
Sage Cell
Code
a = 2^20 % 7
a
Options
None
Tags
Primary Tags—Programming: The Python language; Arithmetic: Integers, Fractions/rational numbers, Real numbers.
Secondary Tags—The Python language: Expressions and operators, Numeric operations. Integers: Addition/subtraction, Multiplication, Integer division, Exponentiation. Fractions/rational numbers: Addition/subtraction, Multiplication, Integer division, Exponentiation. Real numbers: Addition/subtraction, Multiplication, Integer division, Exponentiation.
Related Cells
Attribute
Permalink:
Author: T. Judson
Date: 28 Jun 2017 14:14
Submitted by: Tom Judson