]>
Commit | Line | Data |
---|---|---|
57391dda FR |
1 | |
2 | ||
3 | /* Stub for defining degree-valued trigonemetric functions using MPFR. | |
99dee823 | 4 | Copyright (C) 2000-2021 Free Software Foundation, Inc. |
57391dda FR |
5 | Contributed by Fritz Reese <foreese@gcc.gnu.org> |
6 | and Steven G. Kargl <kargl@gcc.gnu.org> | |
7 | ||
8 | This file is part of GCC. | |
9 | ||
10 | GCC is free software; you can redistribute it and/or modify it under | |
11 | the terms of the GNU General Public License as published by the Free | |
12 | Software Foundation; either version 3, or (at your option) any later | |
13 | version. | |
14 | ||
15 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
16 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
17 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
18 | for more details. | |
19 | ||
20 | You should have received a copy of the GNU General Public License | |
21 | along with GCC; see the file COPYING3. If not see | |
22 | <http://www.gnu.org/licenses/>. */ | |
23 | ||
24 | #define FTYPE mpfr_t | |
25 | #define RETTYPE void | |
26 | #define RETURN(x) do { } while (0) | |
27 | #define ITYPE mpz_t | |
28 | ||
29 | #define ISFINITE(x) mpfr_number_p(x) | |
30 | #define D2R(x) deg2rad(x) | |
31 | ||
e8eecc2a FR |
32 | #define ENABLE_SIND |
33 | #define ENABLE_COSD | |
34 | #define ENABLE_TAND | |
35 | ||
57391dda FR |
36 | #define SIND simplify_sind |
37 | #define COSD simplify_cosd | |
38 | #define TAND simplify_tand | |
39 | ||
e8eecc2a FR |
40 | /* cosd(30) === sqrt(3) / 2. */ |
41 | #define SET_COSD30(x) do { \ | |
42 | mpfr_set_ui (x, 3, GFC_RND_MODE); \ | |
43 | mpfr_sqrt (x, x, GFC_RND_MODE); \ | |
44 | mpfr_div_ui (x, x, 2, GFC_RND_MODE); \ | |
45 | } while (0) | |
57391dda FR |
46 | |
47 | static RETTYPE SIND (FTYPE); | |
48 | static RETTYPE COSD (FTYPE); | |
49 | static RETTYPE TAND (FTYPE); | |
50 | ||
51 | #include "../../libgfortran/intrinsics/trigd.inc" | |
52 | ||
53 | /* vim: set ft=c: */ |