_nfloat_add_1, _nfloat_sub_1, _nfloat_add_2, _nfloat_sub_2, _nfloat_add_3, _nfloat_sub_3, _nfloat_add_4, _nfloat_sub_4, _nfloat_add_n, _nfloat_sub_n
Synopsis
#include <flint/nfloat.h>int _nfloat_add_1(nfloat_ptr res, ulong x0, slong xexp, int xsgnbit, ulong y0, slong delta, gr_ctx_t ctx)sourceint _nfloat_sub_1(nfloat_ptr res, ulong x0, slong xexp, int xsgnbit, ulong y0, slong delta, gr_ctx_t ctx)sourceint _nfloat_add_2(nfloat_ptr res, nn_srcptr xd, slong xexp, int xsgnbit, nn_srcptr yd, slong delta, gr_ctx_t ctx)sourceint _nfloat_sub_2(nfloat_ptr res, nn_srcptr xd, slong xexp, int xsgnbit, nn_srcptr yd, slong delta, gr_ctx_t ctx)sourceint _nfloat_add_3(nfloat_ptr res, nn_srcptr x, slong xexp, int xsgnbit, nn_srcptr y, slong delta, gr_ctx_t ctx)sourceint _nfloat_sub_3(nfloat_ptr res, nn_srcptr x, slong xexp, int xsgnbit, nn_srcptr y, slong delta, gr_ctx_t ctx)sourceint _nfloat_add_4(nfloat_ptr res, nn_srcptr x, slong xexp, int xsgnbit, nn_srcptr y, slong delta, gr_ctx_t ctx)sourceint _nfloat_sub_4(nfloat_ptr res, nn_srcptr x, slong xexp, int xsgnbit, nn_srcptr y, slong delta, gr_ctx_t ctx)sourceint _nfloat_add_n(nfloat_ptr res, nn_srcptr xd, slong xexp, int xsgnbit, nn_srcptr yd, slong delta, slong nlimbs, gr_ctx_t ctx)sourceint _nfloat_sub_n(nfloat_ptr res, nn_srcptr xd, slong xexp, int xsgnbit, nn_srcptr yd, slong delta, slong nlimbs, gr_ctx_t ctx)sourceThe fixed-size kernels of addition and subtraction of magnitudes: set res to (-1)^{\mathit{xsgnbit}} (|x| \pm |y|), where x has mantissa x and exponent xexp, and y has mantissa y and exponent xexp - delta with \mathit{delta} \ge 0 (so |x| \ge |y| in exponent, and for subtraction |x| \ge |y|). The mantissas have 1, 2, 3, 4 or nlimbs words.
Cite this page
The FLINT team, “_nfloat_add_1, _nfloat_sub_1, _nfloat_add_2, _nfloat_sub_2, _nfloat_add_3, _nfloat_sub_3, _nfloat_add_4, _nfloat_sub_4, _nfloat_add_n, _nfloat_sub_n (nfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nfloat/_nfloat_add_1.html (generated 2026-10-20).
@misc{flint-doc-nfloat-nfloat-add-1,
author = {{The FLINT team}},
title = {{\_nfloat\_add\_1, \_nfloat\_sub\_1, \_nfloat\_add\_2, \_nfloat\_sub\_2, \_nfloat\_add\_3, \_nfloat\_sub\_3, \_nfloat\_add\_4, \_nfloat\_sub\_4, \_nfloat\_add\_n, \_nfloat\_sub\_n (nfloat.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/nfloat/_nfloat_add_1.html},
note = {Generated 2026-10-20}
}