We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d68c4d0 commit c884ee3Copy full SHA for c884ee3
lib/node_modules/@stdlib/math/base/special/fibonacci-indexf/src/main.c
@@ -26,6 +26,7 @@
26
#include <stdbool.h>
27
28
static const float SQRT_5 = 2.23606797749979f;
29
+static const float LN_PHI = stdlib_base_lnf( STDLIB_CONSTANT_FLOAT32_PHI );
30
31
/**
32
* Computes the Fibonacci number index of a single-precision floating-point number.
@@ -48,5 +49,5 @@ float stdlib_base_fibonacci_indexf( const float F ) {
48
49
return 0.0f / 0.0f; // NaN
50
}
51
x = ( F * SQRT_5 ) + 0.5f;
- return stdlib_base_roundf( stdlib_base_lnf( x ) / stdlib_base_lnf( STDLIB_CONSTANT_FLOAT32_PHI ) );
52
+ return stdlib_base_roundf( stdlib_base_lnf( x ) / LN_PHI );
53
0 commit comments