btxld(8): Convert to hostprog.
[dragonfly.git] / contrib / gmp / mpf / sub_ui.c
blob4ce7595ed2255f083f5f18c0630c5ae492dac8ee
1 /* mpf_sub_ui -- Subtract an unsigned integer from a float.
3 Copyright 1993, 1994, 1996, 2001 Free Software Foundation, Inc.
5 This file is part of the GNU MP Library.
7 The GNU MP Library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
12 The GNU MP Library is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
20 #include "gmp.h"
21 #include "gmp-impl.h"
23 void
24 mpf_sub_ui (mpf_ptr sum, mpf_srcptr u, unsigned long int v)
26 __mpf_struct vv;
27 mp_limb_t vl;
29 if (v == 0)
31 mpf_set (sum, u);
32 return;
35 vl = v;
36 vv._mp_size = 1;
37 vv._mp_d = &vl;
38 vv._mp_exp = 1;
39 mpf_sub (sum, u, &vv);