]> git.rkrishnan.org Git - dttsp.git/blobdiff - jDttSP/fastrig.c
Bug fixes to jsdr, keyer
[dttsp.git] / jDttSP / fastrig.c
index 5c4d8ffb472a715f5b5a4c386fcc9bc4a61a679d..52c77b1f239bee542532ce43d75ee3f35a125f30 100644 (file)
@@ -203,10 +203,14 @@ fast_atan2(REAL y, REAL x) {
     /* normalize to +/- 45 degree range */
     y_abs = fabs(y);
     x_abs = fabs(x);
-    z = (y_abs < x_abs ? y_abs / x_abs : x_abs / y_abs);
+    //z = (y_abs < x_abs ? y_abs / x_abs : x_abs / y_abs);
+    if (y_abs < x_abs)
+      z = y_abs / x_abs;
+    else
+      z = x_abs / y_abs;
     /* when ratio approaches the table resolution, the angle is */
     /*      best approximated with the argument itself...       */
-    if (z < TAN_MAP_RES)  base_angle = z;
+    if (z < TAN_MAP_RES) base_angle = z;
     else {
       /* find index and interpolation value */
       alpha = z * (REAL) TAN_MAP_SIZE - .5;