<commit_before><!--

@license Apache-2.0

Copyright (c) 2018 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

# Float32Array

> [Typed array][mdn-typed-array] constructor which returns a [typed array][mdn-typed-array] representing an array of single-precision floating-point numbers in the platform byte order.

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var Float32Array = require( '@stdlib/array/float32' );
```

#### Float32Array()

A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-typed-array] representing an array of single-precision floating-point numbers in the platform byte order.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array();
// returns <Float32Array>
```

#### Float32Array( length )

Returns a [typed array][mdn-typed-array] having a specified length.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]
```

#### Float32Array( typedarray )

Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var Float64Array = require( '@stdlib/array/float64' );

var arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] );
var arr2 = new Float32Array( arr1 );
// returns <Float32Array>[ 0.5, 0.5, 0.5 ]
```

#### Float32Array( obj )

Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( [ 0.5, 0.5, 0.5 ] );
// returns <Float32Array>[ 0.5, 0.5, 0.5 ]
```

#### Float32Array( buffer\[, byteOffset\[, length]] )

Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var ArrayBuffer = require( '@stdlib/array/buffer' );

var buf = new ArrayBuffer( 16 );
var arr = new Float32Array( buf, 0, 4 );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]
```

* * *

### Properties

#### Float32Array.BYTES_PER_ELEMENT

Number of bytes per view element.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var nbytes = Float32Array.BYTES_PER_ELEMENT;
// returns 4
```

#### Float32Array.name

[Typed array][mdn-typed-array] constructor name.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var str = Float32Array.name;
// returns 'Float32Array'
```

#### Float32Array.prototype.buffer

**Read-only** property which returns the [`ArrayBuffer`][mdn-arraybuffer] referenced by the [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var buf = arr.buffer;
// returns <ArrayBuffer>
```

#### Float32Array.prototype.byteLength

**Read-only** property which returns the length (in bytes) of the [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var byteLength = arr.byteLength;
// returns 20
```

#### Float32Array.prototype.byteOffset

**Read-only** property which returns the offset (in bytes) of the [typed array][mdn-typed-array] from the start of its [`ArrayBuffer`][mdn-arraybuffer].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var byteOffset = arr.byteOffset;
// returns 0
```

#### Float32Array.prototype.BYTES_PER_ELEMENT

Number of bytes per view element.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var nbytes = arr.BYTES_PER_ELEMENT;
// returns 4
```

#### Float32Array.prototype.length

**Read-only** property which returns the number of view elements.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var len = arr.length;
// returns 5
```

* * *

### Methods

TODO: add methods

</section><commit_msg>Add anchors<commit_after><!--

@license Apache-2.0

Copyright (c) 2018 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

# Float32Array

> [Typed array][mdn-typed-array] constructor which returns a [typed array][mdn-typed-array] representing an array of single-precision floating-point numbers in the platform byte order.

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

```javascript
var Float32Array = require( '@stdlib/array/float32' );
```

#### Float32Array()

A [typed array][mdn-typed-array] constructor which returns a [typed array][mdn-typed-array] representing an array of single-precision floating-point numbers in the platform byte order.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array();
// returns <Float32Array>
```

#### Float32Array( length )

Returns a [typed array][mdn-typed-array] having a specified length.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]
```

#### Float32Array( typedarray )

Creates a [typed array][mdn-typed-array] from another [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var Float64Array = require( '@stdlib/array/float64' );

var arr1 = new Float64Array( [ 0.5, 0.5, 0.5 ] );
var arr2 = new Float32Array( arr1 );
// returns <Float32Array>[ 0.5, 0.5, 0.5 ]
```

#### Float32Array( obj )

Creates a [typed array][mdn-typed-array] from an array-like `object` or iterable.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( [ 0.5, 0.5, 0.5 ] );
// returns <Float32Array>[ 0.5, 0.5, 0.5 ]
```

#### Float32Array( buffer\[, byteOffset\[, length]] )

Returns a [typed array][mdn-typed-array] view of an [`ArrayBuffer`][mdn-arraybuffer].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var ArrayBuffer = require( '@stdlib/array/buffer' );

var buf = new ArrayBuffer( 16 );
var arr = new Float32Array( buf, 0, 4 );
// returns <Float32Array>[ 0.0, 0.0, 0.0, 0.0 ]
```

* * *

### Properties

<a name="static-prop-bytes-per-element"></a>

#### Float32Array.BYTES_PER_ELEMENT

Number of bytes per view element.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var nbytes = Float32Array.BYTES_PER_ELEMENT;
// returns 4
```

<a name="static-prop-name"></a>

#### Float32Array.name

[Typed array][mdn-typed-array] constructor name.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var str = Float32Array.name;
// returns 'Float32Array'
```

<a name="prop-buffer"></a>

#### Float32Array.prototype.buffer

**Read-only** property which returns the [`ArrayBuffer`][mdn-arraybuffer] referenced by the [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var buf = arr.buffer;
// returns <ArrayBuffer>
```

<a name="prop-byte-length"></a>

#### Float32Array.prototype.byteLength

**Read-only** property which returns the length (in bytes) of the [typed array][mdn-typed-array].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var byteLength = arr.byteLength;
// returns 20
```

<a name="prop-byte-offset"></a>

#### Float32Array.prototype.byteOffset

**Read-only** property which returns the offset (in bytes) of the [typed array][mdn-typed-array] from the start of its [`ArrayBuffer`][mdn-arraybuffer].

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var byteOffset = arr.byteOffset;
// returns 0
```

<a name="prop-bytes-per-element"></a>

#### Float32Array.prototype.BYTES_PER_ELEMENT

Number of bytes per view element.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var nbytes = arr.BYTES_PER_ELEMENT;
// returns 4
```

<a name="prop-length"></a>

#### Float32Array.prototype.length

**Read-only** property which returns the number of view elements.

<!-- eslint-disable stdlib/require-globals -->

```javascript
var arr = new Float32Array( 5 );
var len = arr.length;
// returns 5
```

* * *

### Methods

<a name="static-method-from"></a>

#### factory.from( src\[, map\[, thisArg]] )

Creates a new named typed tuple from an array-like `object` or an iterable.

```javascript
var factory = namedtypedtuple( [ 'x', 'y' ] );

var tuple = factory.from( [ 1.0, -1.0 ] );

var x = tuple.x;
// returns 1.0

x = tuple[ 0 ];
// returns 1.0

var y = tuple.y;
// returns -1.0

y = tuple[ 1 ];
// returns -1.0
```

To invoke a function for each `src` value, provide a callback function.

```javascript
var factory = namedtypedtuple( [ 'x', 'y' ] );

function mapFcn( v ) {
    return v * 2.0;
}

var tuple = factory.from( [ 1.0, -1.0 ], mapFcn );

var x = tuple.x;
// returns 2.0

x = tuple[ 0 ];
// returns 2.0

var y = tuple.y;
// returns -2.0

y = tuple[ 1 ];
// returns -2.0
```

A callback function is provided three arguments:

-   `value`: source value
-   `index`: source index
-   `field`: tuple field

To set the callback execution context, provide a `thisArg`.

```javascript
var factory = namedtypedtuple( [ 'x', 'y' ] );

function mapFcn( v ) {
    this.count += 1;
    return v * 2.0;
}

var ctx = {
    'count': 0
};

var tuple = factory.from( [ 1.0, -1.0 ], mapFcn, ctx );

var n = ctx.count;
// returns 2
```

<a name="static-method-of"></a>

#### factory.of( element0\[, element1\[, ...\[, elementN]]] )

Creates a new named typed tuple from a variable number of arguments.

```javascript
var factory = namedtypedtuple( [ 'x', 'y' ] );

var tuple = factory.of( 1.0, -1.0 );

var x = tuple.x;
// returns 1.0

x = tuple[ 0 ];
// returns 1.0

var y = tuple.y;
// returns -1.0

y = tuple[ 1 ];
// returns -1.0
```

</section>
{'fraction_non_alphanumeric': 0.16091129249260022, 'fraction_numerical': 0.03058570275361019, 'mean_word_length': 3.8583877995642704, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6808584', 'n_tokens_mistral': 3912, 'n_tokens_neox': 3632, 'n_words': 1135}