FLINT3.7.0-dev

n_add_checked, n_sub_checked, n_mul_checked

Synopsis#include <flint/ulong_extras.h>
int n_add_checked(ulong * a, ulong b, ulong c)source
int n_sub_checked(ulong * a, ulong b, ulong c)source
int n_mul_checked(ulong * a, ulong b, ulong c)source

Sets *a to b + c, b - c or bc modulo B and returns 1 if the exact result does not fit in a ulong, otherwise 0.

Cite this page

The FLINT team, “n_add_checked, n_sub_checked, n_mul_checked (ulong_extras.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ulong_extras/n_add_checked.html (generated 2026-10-20).