GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
sincos.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2002,2004 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_GR_SINCOS_H
12#define INCLUDED_GR_SINCOS_H
13
14#include <gnuradio/api.h>
15#include <cmath>
16
17namespace gr {
18
19#if defined(HAVE_SINCOS)
20
21inline void sincos(double x, double* sinx, double* cosx) { ::sincos(x, sinx, cosx); }
22
23#else
24
25inline void sincos(double x, double* sinx, double* cosx)
26{
27 *sinx = ::sin(x);
28 *cosx = ::cos(x);
29}
30
31#endif
32
33// ----------------------------------------------------------------
34
35#if defined(HAVE_SINCOSF)
36
37inline void sincosf(float x, float* sinx, float* cosx) { ::sincosf(x, sinx, cosx); }
38
39#elif defined(HAVE_SINF) && defined(HAVE_COSF)
40
41inline void sincosf(float x, float* sinx, float* cosx)
42{
43 *sinx = ::sinf(x);
44 *cosx = ::cosf(x);
45}
46
47#else
48
49inline void sincosf(float x, float* sinx, float* cosx)
50{
51 *sinx = ::sin(x);
52 *cosx = ::cos(x);
53}
54
55#endif
56
57} // namespace gr
58
59#endif /* INCLUDED_GR_SINCOS_H */
GNU Radio logging wrapper.
Definition: basic_block.h:29
void sincos(double x, double *sinx, double *cosx)
Definition: sincos.h:25
void sincosf(float x, float *sinx, float *cosx)
Definition: sincos.h:49