Mercurial > gnulib
annotate lib/truncl.c @ 40196:e63f5d3edab5
relocatable-prog: Update documentation.
* doc/relocatable-maint.texi (Supporting Relocation): Update to match
the recent changes.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 24 Feb 2019 01:49:15 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
9287 | 1 /* Round towards zero. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. |
9287 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9287
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
9287 | 5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9287
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9287
diff
changeset
|
7 (at your option) any later version. |
9287 | 8 |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9287
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
19190 | 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
9287 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ | |
18 | |
15926
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
19 #include <config.h> |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
20 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
21 #if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
22 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
23 /* Specification. */ |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
24 # include <math.h> |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
25 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
26 long double |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
27 truncl (long double x) |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
28 { |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
29 return trunc (x); |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
30 } |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
31 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
32 #else |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
33 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
34 # define USE_LONG_DOUBLE |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
35 # include "trunc.c" |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
36 |
23d150bba2eb
truncl: Simplify for platforms where 'long double' == 'double'.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
37 #endif |