1
2
3/* Stub for defining degree-valued trigonemetric functions using MPFR.
4 Copyright (C) 2000-2023 Free Software Foundation, Inc.
5 Contributed by Fritz Reese <foreese@gcc.gnu.org>
6 and Steven G. Kargl <kargl@gcc.gnu.org>
7
8This file is part of GCC.
9
10GCC is free software; you can redistribute it and/or modify it under
11the terms of the GNU General Public License as published by the Free
12Software Foundation; either version 3, or (at your option) any later
13version.
14
15GCC is distributed in the hope that it will be useful, but WITHOUT ANY
16WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18for more details.
19
20You should have received a copy of the GNU General Public License
21along 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
32#define ENABLE_SIND
33#define ENABLE_COSD
34#define ENABLE_TAND
35
36#define SIND simplify_sind
37#define COSD simplify_cosd
38#define TAND simplify_tand
39
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)
46
47static RETTYPE SIND (FTYPE);
48static RETTYPE COSD (FTYPE);
49static RETTYPE TAND (FTYPE);
50
51#include "../../libgfortran/intrinsics/trigd.inc"
52
53/* vim: set ft=c: */
54

source code of gcc/fortran/trigd_fe.inc