From 0f359f929f856b7bbf3215cb3d3f0e85880d9056 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sat, 7 Dec 2024 21:32:24 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 23 +++ float32/sqrt-three/README.md | 135 ++++++++++++++++++ float32/sqrt-three/docs/repl.txt | 12 ++ float32/sqrt-three/docs/types/index.d.ts | 33 +++++ float32/sqrt-three/docs/types/test.ts | 28 ++++ float32/sqrt-three/examples/index.js | 24 ++++ .../stdlib/constants/float64/sqrt_three.h | 27 ++++ float32/sqrt-three/lib/index.js | 51 +++++++ float32/sqrt-three/manifest.json | 36 +++++ float32/sqrt-three/package.json | 68 +++++++++ float32/sqrt-three/test/test.js | 40 ++++++ 11 files changed, 477 insertions(+) create mode 100644 float32/sqrt-three/README.md create mode 100644 float32/sqrt-three/docs/repl.txt create mode 100644 float32/sqrt-three/docs/types/index.d.ts create mode 100644 float32/sqrt-three/docs/types/test.ts create mode 100644 float32/sqrt-three/examples/index.js create mode 100644 float32/sqrt-three/include/stdlib/constants/float64/sqrt_three.h create mode 100644 float32/sqrt-three/lib/index.js create mode 100644 float32/sqrt-three/manifest.json create mode 100644 float32/sqrt-three/package.json create mode 100644 float32/sqrt-three/test/test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 22c917a3..902749e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -244,6 +244,28 @@ This release closes the following issue: +
+ +#### [@stdlib/constants/float32/sqrt-three](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float32/sqrt-three) + +
+ +
+ +##### Features + +- [`935a1af`](https://github.com/stdlib-js/stdlib/commit/935a1af66c02a850e34d9e61538559c330beb7e0) - add `constants/float32/sqrt-three` [(#3322)](https://github.com/stdlib-js/stdlib/pull/3322) + +
+ + + +
+ +
+ + +
#### [@stdlib/constants/float32/sqrt-two](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/constants/float32/sqrt-two) @@ -339,6 +361,7 @@ A total of 6 people contributed to this release. Thank you to the following cont
+- [`935a1af`](https://github.com/stdlib-js/stdlib/commit/935a1af66c02a850e34d9e61538559c330beb7e0) - **feat:** add `constants/float32/sqrt-three` [(#3322)](https://github.com/stdlib-js/stdlib/pull/3322) _(by Manvith)_ - [`f74239a`](https://github.com/stdlib-js/stdlib/commit/f74239a7b9e105a5694432d53bcf912d289c0417) - **feat:** add constants/float32/sqrt-half [(#3334)](https://github.com/stdlib-js/stdlib/pull/3334) _(by Manvith, stdlib-bot)_ - [`7127b56`](https://github.com/stdlib-js/stdlib/commit/7127b567c3fba95eb1e923e763569ba4b58ed262) - **feat:** add `constants/float32/sqrt-pi` [(#3326)](https://github.com/stdlib-js/stdlib/pull/3326) _(by Gururaj Gurram, Gunj Joshi)_ - [`cf471dc`](https://github.com/stdlib-js/stdlib/commit/cf471dca2b71b8664737d72558ae40764d8bcddb) - **feat:** add `constants/float32/sqrt-two` [(#3328)](https://github.com/stdlib-js/stdlib/pull/3328) _(by Gururaj Gurram)_ diff --git a/float32/sqrt-three/README.md b/float32/sqrt-three/README.md new file mode 100644 index 00000000..af32db8f --- /dev/null +++ b/float32/sqrt-three/README.md @@ -0,0 +1,135 @@ + + +# FLOAT32_SQRT3 + +> [Square root][@stdlib/math/base/special/sqrtf] of `3` as a single-precision floating-point number. + +
+ +## Usage + +```javascript +var FLOAT32_SQRT3 = require( '@stdlib/constants/float32/sqrt-three' ); +``` + +#### FLOAT32_SQRT3 + +[Square root][@stdlib/math/base/special/sqrtf] of `3` as a single-precision floating-point number. + +```javascript +var bool = ( FLOAT32_SQRT3 === 1.7320507764816284 ); +// returns true +``` + +
+ + + +
+ +## Examples + + + + + +```javascript +var FLOAT32_SQRT3 = require( '@stdlib/constants/float32/sqrt-three' ); + +console.log( FLOAT32_SQRT3 ); +// => 1.7320507764816284 +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/constants/float32/sqrt_three.h" +``` + +#### STDLIB_CONSTANT_FLOAT32_SQRT3 + +Macro for the [square root][@stdlib/math/base/special/sqrtf] of `3` as a single-precision floating-point number. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + diff --git a/float32/sqrt-three/docs/repl.txt b/float32/sqrt-three/docs/repl.txt new file mode 100644 index 00000000..3ae7d62a --- /dev/null +++ b/float32/sqrt-three/docs/repl.txt @@ -0,0 +1,12 @@ + +{{alias}} + Square root of `3` as a single-precision floating-point number. + + Examples + -------- + > {{alias}} + 1.7320507764816284 + + See Also + -------- + diff --git a/float32/sqrt-three/docs/types/index.d.ts b/float32/sqrt-three/docs/types/index.d.ts new file mode 100644 index 00000000..ee4306d3 --- /dev/null +++ b/float32/sqrt-three/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +// TypeScript Version: 4.1 + +/** +* Square root of `3` as a single-precision floating-point number. +* +* @example +* var val = FLOAT32_SQRT3; +* // returns 1.7320507764816284 +*/ +declare const FLOAT32_SQRT3: number; + + +// EXPORTS // + +export = FLOAT32_SQRT3; diff --git a/float32/sqrt-three/docs/types/test.ts b/float32/sqrt-three/docs/types/test.ts new file mode 100644 index 00000000..816715e0 --- /dev/null +++ b/float32/sqrt-three/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +import FLOAT32_SQRT3 = require( './index' ); + + +// TESTS // + +// The export is a number... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + FLOAT32_SQRT3; // $ExpectType number +} diff --git a/float32/sqrt-three/examples/index.js b/float32/sqrt-three/examples/index.js new file mode 100644 index 00000000..c2586f1a --- /dev/null +++ b/float32/sqrt-three/examples/index.js @@ -0,0 +1,24 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +var FLOAT32_SQRT3 = require( './../lib' ); + +console.log( FLOAT32_SQRT3 ); +// => 1.7320507764816284 diff --git a/float32/sqrt-three/include/stdlib/constants/float64/sqrt_three.h b/float32/sqrt-three/include/stdlib/constants/float64/sqrt_three.h new file mode 100644 index 00000000..b94c91bc --- /dev/null +++ b/float32/sqrt-three/include/stdlib/constants/float64/sqrt_three.h @@ -0,0 +1,27 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +#ifndef STDLIB_CONSTANTS_FLOAT32_SQRT_THREE_H +#define STDLIB_CONSTANTS_FLOAT32_SQRT_THREE_H + +/** +* Macro for the square root of 3 as a single-precision floating-point number. +*/ +#define STDLIB_CONSTANT_FLOAT32_SQRT3 1.7320507764816284f + +#endif // !STDLIB_CONSTANTS_FLOAT32_SQRT_THREE_H diff --git a/float32/sqrt-three/lib/index.js b/float32/sqrt-three/lib/index.js new file mode 100644 index 00000000..30f8c0c9 --- /dev/null +++ b/float32/sqrt-three/lib/index.js @@ -0,0 +1,51 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +/** +* Square root of `3` as a single-precision floating-point number. +* +* @module @stdlib/constants/float32/sqrt-three +* @type {number} +* +* @example +* var FLOAT32_SQRT3 = require( '@stdlib/constants/float32/sqrt-three' ); +* // returns 1.7320507764816284 +*/ + + +// MAIN // + +/** +* Square root of `3` as a single-precision floating-point number. +* +* ```tex +* \sqrt{3} +* ``` +* +* @constant +* @type {number} +* @default 1.7320507764816284 +*/ +var FLOAT32_SQRT3 = 1.7320507764816284; + + +// EXPORTS // + +module.exports = FLOAT32_SQRT3; diff --git a/float32/sqrt-three/manifest.json b/float32/sqrt-three/manifest.json new file mode 100644 index 00000000..844d692f --- /dev/null +++ b/float32/sqrt-three/manifest.json @@ -0,0 +1,36 @@ +{ + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [] + } + ] +} diff --git a/float32/sqrt-three/package.json b/float32/sqrt-three/package.json new file mode 100644 index 00000000..bb399ddb --- /dev/null +++ b/float32/sqrt-three/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/constants/float32/sqrt-three", + "version": "0.0.0", + "description": "Square root of 3 as a single-precision floating-point number.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "constant", + "const", + "mathematics", + "math", + "sqrt", + "square", + "root", + "three", + "sqrt3", + "ieee754", + "single", + "floating-point", + "float32" + ] +} diff --git a/float32/sqrt-three/test/test.js b/float32/sqrt-three/test/test.js new file mode 100644 index 00000000..bba942ed --- /dev/null +++ b/float32/sqrt-three/test/test.js @@ -0,0 +1,40 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var sqrtf = require( '@stdlib/math/base/special/sqrtf' ); +var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); +var FLOAT32_SQRT3 = require( './../lib' ); + + +// TESTS // + +tape( 'main export is a number', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof FLOAT32_SQRT3, 'number', 'main export is a number' ); + t.end(); +}); + +tape( 'the exported value is a single-precision floating-point number equal to the square root of 3', function test( t ) { + t.equal( FLOAT32_SQRT3, float64ToFloat32( sqrtf( 3 ) ), 'equals sqrtf(3)' ); + t.end(); +});