Commit 6328beb7 authored by Dan Ibanez's avatar Dan Ibanez
Browse files

fix double-return warning

this #ifdef adds a return statement
for little endian machines, but leaves
the old one, which the compiler comlains
is unreachable. this commit combines
the conditionals so we can use #else
parent caea8973
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -42,12 +42,11 @@ namespace MathSpecialKokkos {
  {
    x *= x;
    x *= 1.4426950408889634074; // log_2(e)
#if defined(__BYTE_ORDER__)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if defined(__BYTE_ORDER__) &&  __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    return (x < 1023.0) ? exp2_x86(-x) : 0.0;
#endif
#endif
#else
    return (x < 1023.0) ? exp2(-x) : 0.0;
#endif
  }

  // x**2, use instead of pow(x,2.0)
+3 −4
Original line number Diff line number Diff line
@@ -41,12 +41,11 @@ namespace MathSpecial {
  {
    x *= x;
    x *= 1.4426950408889634074; // log_2(e)
#if defined(__BYTE_ORDER__)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    return (x < 1023.0) ? exp2_x86(-x) : 0.0;
#endif
#endif
#else
    return (x < 1023.0) ? exp2(-x) : 0.0;
#endif
  }

  // x**2, use instead of pow(x,2.0)