]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/mc-boot-ch/Gcbuiltin.c
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / mc-boot-ch / Gcbuiltin.c
CommitLineData
1eee94d3
GM
1/* Gcbuiltin.c provides access to some math intrinsic functions.
2
a945c346 3Copyright (C) 2016-2024 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius@glam.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU Modula-2; see the file COPYING3. If not see
20<http://www.gnu.org/licenses/>. */
21
22#include "Gcbuiltin.h"
23
24#include "config.h"
25#include "system.h"
26
27#define exp1 2.7182818284590452353602874713526624977572f
28
29double
30cbuiltin_sqrt (double x)
31{
32 return sqrt (x);
33}
34
35long double
36cbuiltin_sqrtl (long double x)
37{
38 return sqrtl (x);
39}
40
41float
42cbuiltin_sqrtf (float x)
43{
44 return sqrtf (x);
45}
46
47double
48cbuiltin_exp (double x)
49{
50 return exp (x);
51}
52
53float
54cbuiltin_expf (float x)
55{
56 return expf (x);
57}
58
59long double
60cbuiltin_expl (long double x)
61{
62 return expl (x);
63}
64
65/* calculcate ln from log. */
66
67double
68cbuiltin_ln (double x)
69{
70 return log (x) / log (exp1);
71}
72
73float
74cbuiltin_lnf (float x)
75{
76 return logf (x) / logf (exp1);
77}
78
79long double
80cbuiltin_lnl (long double x)
81{
82 return logl (x) / logl (exp1);
83}
84
85double
86cbuiltin_sin (double x)
87{
88 return sin (x);
89}
90
91long double
92cbuiltin_sinl (long double x)
93{
94 return sinl (x);
95}
96
97float
98cbuiltin_sinf (float x)
99{
100 return sinf (x);
101}
102
103double
104cbuiltin_cos (double x)
105{
106 return cos (x);
107}
108
109float
110cbuiltin_cosf (float x)
111{
112 return cosf (x);
113}
114
115long double
116cbuiltin_cosl (long double x)
117{
118 return cosl (x);
119}
120
121double
122cbuiltin_tan (double x)
123{
124 return tan (x);
125}
126
127long double
128cbuiltin_tanl (long double x)
129{
130 return tanl (x);
131}
132
133float
134cbuiltin_tanf (float x)
135{
136 return tanf (x);
137}
138
139double
140cbuiltin_arctan (double x)
141{
142 return atan (x);
143}
144
145float
146cbuiltin_arctanf (float x)
147{
148 return atanf (x);
149}
150
151long double
152arctanl (long double x)
153{
154 return atanl (x);
155}
156
157int
158cbuiltin_entier (double x)
159{
160 return (int)floor (x);
161}
162
163int
164cbuiltin_entierf (float x)
165{
166 return (int)floorf (x);
167}
168
169int
170cbuiltin_entierl (long double x)
171{
172 return (int)floorl (x);
173}