[][src]Module rdcl_aoc_helpers::math

Math.

Modules

polynomial
with_gcd

Functions

abs_diff

The absolute difference between two numbers.

bezout_coefficients

Find t and s, such that ta + sb = gcd(p, q).

gcd

Computes the greatest common divisor for numbers a and b. TODO: May return negative values.

lcm

Computes the least common multiple of a and b.

solve_crt

Solve the chinese remainder theorem for (n1, a1) and (n2, a2). We assume that:

taxi_cab_2d

The taxi cab distance between two 2D points.

taxi_cab_3d

The taxi cab distance between two 3D points.

taxi_cab_4d

The taxi cab distance between two 4D points.