Skip to content

Commit 5bccefd

Browse files
committed
refactor: query default dtype
1 parent ff4e25b commit 5bccefd

File tree

1 file changed

+3
-1
lines changed
  • lib/node_modules/@stdlib/array/ones/lib

1 file changed

+3
-1
lines changed

lib/node_modules/@stdlib/array/ones/lib/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
var Complex128 = require( '@stdlib/complex/float64' );
2424
var Complex64 = require( '@stdlib/complex/float32' );
2525
var full = require( '@stdlib/array/full' );
26+
var defaults = require( '@stdlib/array/defaults' );
2627

2728

2829
// VARIABLES //
2930

3031
var Z128 = new Complex128( 1.0, 0.0 );
3132
var Z64 = new Complex64( 1.0, 0.0 );
33+
var DEFAULT_DTYPE = defaults.get( 'dtypes.default' );
3234

3335

3436
// MAIN //
@@ -57,7 +59,7 @@ function ones( length ) {
5759
if ( arguments.length > 1 ) {
5860
dtype = arguments[ 1 ];
5961
} else {
60-
dtype = 'float64';
62+
dtype = DEFAULT_DTYPE;
6163
}
6264
if ( dtype === 'complex128' ) {
6365
value = Z128;

0 commit comments

Comments
 (0)