<commit_before>Set High Word
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Sets the more significant 32 bits of a [double-precision floating-point number][ieee754].


## Installation

``` bash
$ npm install math-float64-set-high-word
```


## Usage

``` javascript
var setHighWord = require( 'math-float64-set-high-word' );
```

#### setHighWord( x, high )

Sets the more significant 32 bits (higher order word) of a [double-precision floating-point number][ieee754] `x` to a bit sequence represented by an unsigned 32-bit integer `high`. The returned `double` will have the same less significant 32 bits (lower order word) as `x`.

``` javascript
var high = 5;
// => 0 00000000000 00000000000000000101

var y = setHighWord( 3.14e201, high );
// returns 1.18350528745e-313 => 0 00000000000 0000000000000000010110010011110010110101100010000010

var pinf = require( 'const-pinf-float64' );
// returns +infinity => 0 11111111111 00000000000000000000 00000000000000000000000000000000

high = 1072693248;
// => 0 01111111111 00000000000000000000

// Set the higher order bits of `+infinity` to return `1`:
y = setHighWord( pinf, high );
// returns 1 => 0 01111111111 0000000000000000000000000000000000000000000000000000
```


## Examples

``` javascript
var pow = require( 'math-power' );
var round = require( 'math-round' );
var setHighWord = require( 'math-float64-set-high-word' );

var MAX_UINT;
var high;
var frac;
var exp;
var x;
var y;
var i;

// Max unsigned 32-bit integer:
MAX_UINT = pow( 2, 32 ) - 1;

// Generate a random double-precision floating-point number:
frac = Math.random() * 10;
exp = -round( Math.random() * 323 );
x = frac * pow( 10, exp );<commit_msg>Update README example to make higher order word an explicit integer<commit_after>Set High Word
===
[![NPM version][npm-image]][npm-url] [![Build Status][build-image]][build-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][dependencies-image]][dependencies-url]

> Sets the more significant 32 bits of a [double-precision floating-point number][ieee754].


## Installation

``` bash
$ npm install math-float64-set-high-word
```


## Usage

``` javascript
var setHighWord = require( 'math-float64-set-high-word' );
```

#### setHighWord( x, high )

Sets the more significant 32 bits (higher order word) of a [double-precision floating-point number][ieee754] `x` to a bit sequence represented by an unsigned 32-bit integer `high`. The returned `double` will have the same less significant 32 bits (lower order word) as `x`.

``` javascript
var high = 5 >>> 0;
// => 0 00000000000 00000000000000000101

var y = setHighWord( 3.14e201, high );
// returns 1.18350528745e-313 => 0 00000000000 0000000000000000010110010011110010110101100010000010

var pinf = require( 'const-pinf-float64' );
// returns +infinity => 0 11111111111 00000000000000000000 00000000000000000000000000000000

high = 1072693248 >>> 0;
// => 0 01111111111 00000000000000000000

// Set the higher order bits of `+infinity` to return `1`:
y = setHighWord( pinf, high );
// returns 1 => 0 01111111111 0000000000000000000000000000000000000000000000000000
```


## Examples

``` javascript
var pow = require( 'math-power' );
var round = require( 'math-round' );
var setHighWord = require( 'math-float64-set-high-word' );

var MAX_UINT;
var high;
var frac;
var exp;
var x;
var y;
var i;

// Max unsigned 32-bit integer:
MAX_UINT = pow( 2, 32 ) - 1;

// Generate a random double-precision floating-point number:
frac = Math.random() * 10;
exp = -round( Math.random() * 323 );
x = frac * pow( 10, exp );
{'fraction_non_alphanumeric': 0.13614262560777957, 'fraction_numerical': 0.17612101566720692, 'mean_word_length': 4.7410852713178295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 22, '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': '3558836', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1117, 'n_words': 378}