3 * Copyright 2003,2005 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Radio; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street,
20 * Boston, MA 02110-1301, USA.
24 * mathematical odds and ends.
30 long gr_gcd (long m, long n);
32 // returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise
33 int gr_isnan (double value);
35 // returns a non-zero value if the value of x has its sign bit set.
37 // This is not the same as `x < 0.0', because IEEE 754 floating point
38 // allows zero to be signed. The comparison `-0.0 < 0.0' is false, but
39 // `gr_signbit (-0.0)' will return a nonzero value.
41 int gr_signbit (double x);
44 * \brief Fast arc tangent using table lookup and linear interpolation
46 * \param y component of input vector
47 * \param x component of input vector
48 * \returns float angle angle of vector (x, y) in radians
50 * This function calculates the angle of the vector (x,y) based on a
51 * table lookup and linear interpolation. The table uses a 256 point
52 * table covering -45 to +45 degrees and uses symetry to determine the
53 * final angle value in the range of -180 to 180 degrees. Note that
54 * this function uses the small angle approximation for values close
55 * to zero. This routine calculates the arc tangent with an average
56 * error of +/- 0.045 degrees.
58 float gr_fast_atan2f(float y, float x);
60 #endif /* _GR_MATH_H_ */