File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
lib/node_modules/@stdlib/math/base/special/kernel-log1pf Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ for ( i = 0; i < x.length; i++ ) {
113113Computes ` logf(1+f) - f ` for ` 1+f ` in ` ~[sqrtf(2)/2, sqrtf(2)] ` .
114114
115115``` c
116- double out = stdlib_base_kernel_log1pf( 1.0 );
117- // returns ~0.1931
116+ float out = stdlib_base_kernel_log1pf( 1 .0f );
117+ // returns ~0.1931f
118118```
119119
120120The function accepts the following arguments:
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ static float polyval_q( const float x ) {
8484* @return output value
8585*
8686* @example
87- * double out = stdlib_base_kernel_log1p( 1.0 );
88- * // returns ~0.1931
87+ * float out = stdlib_base_kernel_log1p( 1.0f );
88+ * // returns ~0.1931f
8989*/
9090float stdlib_base_kernel_log1pf ( const float f ) {
9191 float hfsq ;
Original file line number Diff line number Diff line change @@ -71,3 +71,9 @@ tape( 'the function correctly computes `logf(1+f) - f` for `1+f` satisfying `sqr
7171 }
7272 t . end ( ) ;
7373} ) ;
74+
75+ tape ( 'the function returns `0` if provided `0`' , function test ( t ) {
76+ var v = kernelLog1pf ( 0.0 ) ;
77+ t . equal ( v , 0.0 , 'returns expected value' ) ;
78+ t . end ( ) ;
79+ } ) ;
Original file line number Diff line number Diff line change @@ -80,3 +80,9 @@ tape( 'the function correctly computes `logf(1+f) - f` for `1+f` satisfying `sqr
8080 }
8181 t . end ( ) ;
8282} ) ;
83+
84+ tape ( 'the function returns `0` if provided `0`' , opts , function test ( t ) {
85+ var v = kernelLog1pf ( 0.0 ) ;
86+ t . equal ( v , 0.0 , 'returns expected value' ) ;
87+ t . end ( ) ;
88+ } ) ;
You can’t perform that action at this time.
0 commit comments