function scalar2ndarray( value ) {
	var options;
	var opts;
	var buf;
	var flg;
	var set;
	var dt;
	var v;

	opts = {
		'dtype': '',
		'order': ORDER,
		'readonly': false
	};
	if ( arguments.length > 1 ) {
		options = arguments[ 1 ];
		if ( !isPlainObject( options ) ) {
			throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
		}
		if ( hasOwnProp( options, 'dtype' ) ) {
			opts.dtype = options.dtype;
		}
		if ( hasOwnProp( options, 'order' ) ) {
			opts.order = options.order;
		}
		if ( hasOwnProp( options, 'readonly' ) ) {
			opts.readonly = options.readonly;
		}
	}
	flg = isNumber( value );
	if ( opts.dtype === '' ) {
		if ( flg ) {
			dt = DEFAULT_REAL;
		} else if ( isBoolean( value ) ) {
			dt = DEFAULT_BOOL;
		} else if ( isComplexLike( value ) ) {
			dt = dtype( value );
			if ( dt === null ) {
				dt = DEFAULT_CMPLX;
			}
		} else {
			dt = 'generic';
		}
	} else {
		dt = opts.dtype;
	}
	buf = buffer( dt, 1 );
	if ( buf === null ) {
		throw new TypeError( format( 'invalid option. `%s` option must be a recognized data type. Option: `%s`.', 'dtype', dt ) );
	}
	if ( isComplexDataType( dt ) && flg ) {
		v = [ value, 0.0 ]; // note: we're assuming that the ComplexXXArray setter accepts an array of interleaved real and imaginary components
	} else {
		v = value;
	}
	if ( isAccessorArray( buf ) ) {
		set = accessorSetter( dt );
	} else {
		set = setter( dt );
	}
	set( buf, 0, v );
	return new ndarray( dt, buf, [], [ 0 ], 0, opts.order, opts );
}
Returns a zero-dimensional ndarray containing a provided scalar value.

## Notes

-   If a `dtype` option is not provided and `value`

    -   is a number, the default data type is the default real-valued floating-point data type.
    -   is a boolean, the default data type is the default boolean data type.
    -   is a complex number object of a known complex data type, the data type is the same as the provided value.
    -   is a complex number object of an unknown complex data type, the default data type is the default complex-valued floating-point data type.
    -   is any other value type, the default data type is `'generic'`.

@param {*} value - scalar value
@param {Options} [options] - function options
@param {string} [options.dtype] - output array data type
@param {string} [options.order="row-major"] - memory layout (either row-major or column-major)
@param {boolean} [options.readonly=false] - boolean indicating whether an array should be read-only
@throws {TypeError} second argument must be an object
@throws {TypeError} `dtype` option must be a recognized data type
@returns {ndarray} ndarray

@example
var x = scalar2ndarray( 1.0 );
// returns <ndarray>

var sh = x.shape;
// returns []

var dt = x.dtype;
// returns 'float64'

var v = x.get();
// returns 1.0

@example
var x = scalar2ndarray( 1.0, {
    'dtype': 'float32'
});
// returns <ndarray>

var sh = x.shape;
// returns []

var dt = x.dtype;
// returns 'float32'

var v = x.get();
// returns 1.0