function ones( length ) {
	var dtype;
	var value;

	if ( arguments.length > 1 ) {
		dtype = arguments[ 1 ];
	} else {
		dtype = DEFAULT_DTYPE;
	}
	if ( dtype === 'complex128' ) {
		value = Z128;
	} else if ( dtype === 'complex64' ) {
		value = Z64;
	} else {
		value = 1;
	}
	return full( length, value, dtype );
}
Creates an array filled with ones and having a specified length.

@param {NonNegativeInteger} length - array length
@param {string} [dtype="float64"] - data type
@throws {TypeError} first argument must be a nonnegative integer
@throws {TypeError} second argument must be a recognized data type
@returns {(TypedArray|Array|ComplexArray)} array or typed array

@example
var arr = ones( 2 );
// returns <Float64Array>[ 1.0, 1.0 ]

@example
var arr = ones( 2, 'float32' );
// returns <Float32Array>[ 1.0, 1.0 ]