README.md (5250B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # Float32 22 23 > Base utilities for single-precision floating-point numbers. 24 25 <section class="usage"> 26 27 ## Usage 28 29 ```javascript 30 var ns = require( '@stdlib/number/float32/base' ); 31 ``` 32 33 #### ns 34 35 Base utilities for single-precision floating-point numbers. 36 37 ```javascript 38 var o = ns; 39 // returns {...} 40 ``` 41 42 <!-- <toc pattern="*"> --> 43 44 <div class="namespace-toc"> 45 46 - <span class="signature">[`exponentf( x )`][@stdlib/number/float32/base/exponent]</span><span class="delimiter">: </span><span class="description">return an integer corresponding to the unbiased exponent of a single-precision floating-point number.</span> 47 - <span class="signature">[`fromBinaryStringf( bstr )`][@stdlib/number/float32/base/from-binary-string]</span><span class="delimiter">: </span><span class="description">create a single-precision floating-point number from an IEEE 754 literal bit representation.</span> 48 - <span class="signature">[`fromWordf( word )`][@stdlib/number/float32/base/from-word]</span><span class="delimiter">: </span><span class="description">create a single-precision floating-point number from an unsigned integer corresponding to an IEEE 754 binary representation.</span> 49 - <span class="signature">[`normalizef( [out,] x )`][@stdlib/number/float32/base/normalize]</span><span class="delimiter">: </span><span class="description">return a normal number `y` and exponent `exp` satisfying `x = y * 2^exp`.</span> 50 - <span class="signature">[`signbitf( x )`][@stdlib/number/float32/base/signbit]</span><span class="delimiter">: </span><span class="description">return a boolean indicating if the sign bit for a single-precision floating-point number is on (true) or off (false).</span> 51 - <span class="signature">[`significandf( x )`][@stdlib/number/float32/base/significand]</span><span class="delimiter">: </span><span class="description">return an integer corresponding to the significand of a single-precision floating-point number.</span> 52 - <span class="signature">[`toBinaryStringf( x )`][@stdlib/number/float32/base/to-binary-string]</span><span class="delimiter">: </span><span class="description">return a string giving the literal bit representation of a single-precision floating-point number.</span> 53 - <span class="signature">[`float32ToInt32( x )`][@stdlib/number/float32/base/to-int32]</span><span class="delimiter">: </span><span class="description">convert a single-precision floating-point number to a signed 32-bit integer.</span> 54 - <span class="signature">[`float32ToUint32( x )`][@stdlib/number/float32/base/to-uint32]</span><span class="delimiter">: </span><span class="description">convert a single-precision floating-point number to an unsigned 32-bit integer.</span> 55 - <span class="signature">[`toWordf( x )`][@stdlib/number/float32/base/to-word]</span><span class="delimiter">: </span><span class="description">return an unsigned 32-bit integer corresponding to the IEEE 754 binary representation of a single-precision floating-point number.</span> 56 57 </div> 58 59 <!-- </toc> --> 60 61 </section> 62 63 <!-- /.usage --> 64 65 <section class="examples"> 66 67 ## Examples 68 69 <!-- TODO: better examples --> 70 71 <!-- eslint no-undef: "error" --> 72 73 ```javascript 74 var objectKeys = require( '@stdlib/utils/keys' ); 75 var ns = require( '@stdlib/number/float32/base' ); 76 77 console.log( objectKeys( ns ) ); 78 ``` 79 80 </section> 81 82 <!-- /.examples --> 83 84 <section class="links"> 85 86 <!-- <toc-links> --> 87 88 [@stdlib/number/float32/base/exponent]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/exponent 89 90 [@stdlib/number/float32/base/from-binary-string]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/from-binary-string 91 92 [@stdlib/number/float32/base/from-word]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/from-word 93 94 [@stdlib/number/float32/base/normalize]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/normalize 95 96 [@stdlib/number/float32/base/signbit]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/signbit 97 98 [@stdlib/number/float32/base/significand]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/significand 99 100 [@stdlib/number/float32/base/to-binary-string]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/to-binary-string 101 102 [@stdlib/number/float32/base/to-int32]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/to-int32 103 104 [@stdlib/number/float32/base/to-uint32]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/to-uint32 105 106 [@stdlib/number/float32/base/to-word]: https://www.npmjs.com/package/@stdlib/number/tree/main/float32/base/to-word 107 108 <!-- </toc-links> --> 109 110 </section> 111 112 <!-- /.links -->