Skip to content

Commit 511d154

Browse files
committed
feat: add constants/float16/min-base10-exponent-subnormal
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 1c08d9e commit 511d154

File tree

10 files changed

+474
-0
lines changed

10 files changed

+474
-0
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 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+
# FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL
22+
23+
> The minimum base 10 exponent for a subnormal [half-precision floating-point number][ieee754].
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
<!-- eslint-disable id-length -->
30+
31+
```javascript
32+
var FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float16/min-base10-exponent-subnormal' );
33+
```
34+
35+
#### FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL
36+
37+
The minimum base 10 exponent for a subnormal [half-precision floating-point number][ieee754].
38+
39+
<!-- eslint-disable id-length -->
40+
41+
```javascript
42+
var bool = ( FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL === -8 );
43+
// returns true
44+
```
45+
46+
</section>
47+
48+
<!-- /.usage -->
49+
50+
<section class="examples">
51+
52+
## Examples
53+
54+
<!-- TODO: better example -->
55+
56+
<!-- eslint no-undef: "error" -->
57+
58+
<!-- eslint-disable id-length -->
59+
60+
```javascript
61+
var FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float16/min-base10-exponent-subnormal' );
62+
63+
console.log( FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL );
64+
// => -8
65+
```
66+
67+
</section>
68+
69+
<!-- /.examples -->
70+
71+
<!-- C interface documentation. -->
72+
73+
* * *
74+
75+
<section class="c">
76+
77+
## C APIs
78+
79+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
80+
81+
<section class="intro">
82+
83+
</section>
84+
85+
<!-- /.intro -->
86+
87+
<!-- C usage documentation. -->
88+
89+
<section class="usage">
90+
91+
### Usage
92+
93+
```c
94+
#include "stdlib/constants/float16/min_base10_exponent_subnormal.h"
95+
```
96+
97+
#### STDLIB_CONSTANT_FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL
98+
99+
Macro for the minimum base 10 exponent for a subnormal [half-precision floating-point number][ieee754].
100+
101+
</section>
102+
103+
<!-- /.usage -->
104+
105+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
106+
107+
<section class="notes">
108+
109+
</section>
110+
111+
<!-- /.notes -->
112+
113+
<!-- C API usage examples. -->
114+
115+
<section class="examples">
116+
117+
</section>
118+
119+
<!-- /.examples -->
120+
121+
</section>
122+
123+
<!-- /.c -->
124+
125+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
126+
127+
<section class="related">
128+
129+
* * *
130+
131+
## See Also
132+
133+
- <span class="package-name">[`@stdlib/constants/float16/min-base10-exponent`][@stdlib/constants/float16/min-base10-exponent]</span><span class="delimiter">: </span><span class="description">the minimum base 10 exponent for a normal half-precision floating-point number.</span>
134+
- <span class="package-name">[`@stdlib/constants/float32/min-base10-exponent-subnormal`][@stdlib/constants/float32/min-base10-exponent-subnormal]</span><span class="delimiter">: </span><span class="description">the minimum base 10 exponent for a subnormal single-precision floating-point number.</span>
135+
136+
</section>
137+
138+
<!-- /.related -->
139+
140+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
141+
142+
<section class="links">
143+
144+
[ieee754]: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
145+
146+
<!-- <related-links> -->
147+
148+
[@stdlib/constants/float16/min-base10-exponent]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float16/min-base10-exponent
149+
150+
[@stdlib/constants/float32/min-base10-exponent-subnormal]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float32/min-base10-exponent-subnormal
151+
152+
<!-- </related-links> -->
153+
154+
</section>
155+
156+
<!-- /.links -->
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
{{alias}}
3+
The minimum base 10 exponent for a subnormal half-precision floating-point
4+
number.
5+
6+
Examples
7+
--------
8+
> {{alias}}
9+
-8
10+
11+
See Also
12+
--------
13+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/**
22+
* The minimum base 10 exponent for a subnormal half-precision floating-point number.
23+
*
24+
* @example
25+
* var min = FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL;
26+
* // returns -8
27+
*/
28+
declare const FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL: number;
29+
30+
31+
// EXPORTS //
32+
33+
export = FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
import FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = require( './index' );
20+
21+
22+
// TESTS //
23+
24+
// The export is a number...
25+
{
26+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
27+
FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL; // $ExpectType number
28+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
var FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = require( './../lib' ); // eslint-disable-line id-length
22+
23+
console.log( FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL );
24+
// => -8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef STDLIB_CONSTANTS_FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL_H
20+
#define STDLIB_CONSTANTS_FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL_H
21+
22+
/**
23+
* Macro for the minimum base 10 exponent for a subnormal half-precision floating-point number.
24+
*/
25+
#define STDLIB_CONSTANT_FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL -8
26+
27+
#endif // !STDLIB_CONSTANTS_FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL_H
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable id-length */
20+
21+
'use strict';
22+
23+
/**
24+
* The minimum base 10 exponent for a subnormal half-precision floating-point number.
25+
*
26+
* @module @stdlib/constants/float16/min-base10-exponent-subnormal
27+
* @type {integer32}
28+
*
29+
* @example
30+
* var FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = require( '@stdlib/constants/float16/min-base10-exponent-subnormal' );
31+
* // returns -8
32+
*/
33+
34+
35+
// MAIN //
36+
37+
/**
38+
* The minimum base 10 exponent for a subnormal half-precision floating-point number.
39+
*
40+
* @constant
41+
* @type {integer32}
42+
* @default -8
43+
* @see [Half-precision floating-point format]{@link https://en.wikipedia.org/wiki/Half-precision_floating-point_format}
44+
*/
45+
var FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL = -8|0; // asm type annotation
46+
47+
48+
// EXPORTS //
49+
50+
module.exports = FLOAT16_MIN_BASE10_EXPONENT_SUBNORMAL;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"options": {},
3+
"fields": [
4+
{
5+
"field": "src",
6+
"resolve": true,
7+
"relative": true
8+
},
9+
{
10+
"field": "include",
11+
"resolve": true,
12+
"relative": true
13+
},
14+
{
15+
"field": "libraries",
16+
"resolve": false,
17+
"relative": false
18+
},
19+
{
20+
"field": "libpath",
21+
"resolve": true,
22+
"relative": false
23+
}
24+
],
25+
"confs": [
26+
{
27+
"src": [],
28+
"include": [
29+
"./include"
30+
],
31+
"libraries": [],
32+
"libpath": [],
33+
"dependencies": []
34+
}
35+
]
36+
}

0 commit comments

Comments
 (0)