File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
lib/node_modules/@stdlib/math/base/special/truncbf/benchmark Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 77* you may not use this file except in compliance with the License.
88* You may obtain a copy of the License at
99*
10- * http://www.apache.org/licenses/LICENSE-2.0
10+ * http://www.apache.org/licenses/LICENSE-2.0
1111*
1212* Unless required by applicable law or agreed to in writing, software
1313* distributed under the License is distributed on an "AS IS" BASIS,
2323var bench = require ( '@stdlib/bench' ) ;
2424var randu = require ( '@stdlib/random/base/randu' ) ;
2525var isnanf = require ( '@stdlib/math/base/assert/is-nanf' ) ;
26+ var trunc = require ( '@stdlib/math/base/special/trunc' ) ;
2627var pkg = require ( './../package.json' ) . name ;
2728var truncbf = require ( './../lib' ) ;
2829
@@ -58,8 +59,9 @@ bench( pkg+'::built-in', function benchmark( b ) {
5859 b . tic ( ) ;
5960 for ( i = 0 ; i < b . iterations ; i ++ ) {
6061 x = ( randu ( ) * 100.0 ) - 50.0 ;
61- // Use Math.trunc instead of just trunc:
62- y = Math . trunc ( x * 100.0 ) / 100.0 ;
62+
63+ // Use stdlib trunc instead of Math.trunc:
64+ y = trunc ( x * 100.0 ) / 100.0 ;
6365 if ( isnanf ( y ) ) {
6466 b . fail ( 'should not return NaN' ) ;
6567 }
You can’t perform that action at this time.
0 commit comments