Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 25, 2024
1 parent f08a7a1 commit 9223dc1
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Aman Bhansali <[email protected]>
Amit Jimiwal <[email protected]>
Anudeep Sanapala <[email protected]>
Athan Reines <[email protected]>
Ayaka <[email protected]>
Brendan Graetz <[email protected]>
Bruno Fenzl <[email protected]>
Bryan Elee <[email protected]>
Expand Down Expand Up @@ -42,6 +43,7 @@ Matt Cochrane <[email protected]>
Mihir Pandit <[email protected]>
Milan Raj <[email protected]>
Momtchil Momtchev <[email protected]>
Muhammad Haris <[email protected]>
Naresh Jagadeesan <[email protected]>
Nithin Katta <[email protected]>
Ognjen Jevremović <[email protected]>
Expand All @@ -62,15 +64,19 @@ Ryan Seal <[email protected]>
Sai Srikar Dumpeti <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shashank Shekhar Singh <[email protected]>
Shivam <[email protected]>
Shraddheya Shendre <[email protected]>
Shubham Mishra <[email protected]>
Snehil Shah <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Suraj kumar <[email protected]>
Tirtadwipa Manunggal <[email protected]>
Utkarsh <http://[email protected]>
Utkarsh Raj <[email protected]>
Varad Gupta <[email protected]>
Yernar Yergaziyev <[email protected]>
naveen <[email protected]>
nishant-s7 <[email protected]>
orimiles5 <[email protected]>
rei2hu <[email protected]>
123 changes: 123 additions & 0 deletions float32/pi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<!--
@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.
-->

# FLOAT32_PI

> The mathematical constant [π][pi].
<section class="usage">

## Usage

```javascript
var FLOAT32_PI = require( '@stdlib/constants/float32/pi' );
```

#### FLOAT32_PI

The mathematical constant [π][pi].

```javascript
var bool = ( FLOAT32_PI === 3.1415927410125732 );
// returns true
```

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- TODO: better example -->

<!-- eslint no-undef: "error" -->

```javascript
var FLOAT32_PI = require( '@stdlib/constants/float32/pi' );

console.log( FLOAT32_PI );
// => 3.1415927410125732
```

</section>

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- 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 -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/constants/float32/pi.h"
```

#### STDLIB_CONSTANT_FLOAT32_PI

Macro for the mathematical constant [π][pi].

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

[pi]: https://en.wikipedia.org/wiki/Pi

</section>

<!-- /.links -->
12 changes: 12 additions & 0 deletions float32/pi/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

{{alias}}
The mathematical constant `π`.

Examples
--------
> {{alias}}
3.1415927410125732

See Also
--------

33 changes: 33 additions & 0 deletions float32/pi/docs/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -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

/**
* The mathematical constant `π`.
*
* @example
* var val = FLOAT32_PI;
* // returns 3.1415927410125732
*/
declare const FLOAT32_PI: number;


// EXPORTS //

export = FLOAT32_PI;
28 changes: 28 additions & 0 deletions float32/pi/docs/types/test.ts
Original file line number Diff line number Diff line change
@@ -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_PI = require( './index' );


// TESTS //

// The export is a number...
{
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
FLOAT32_PI; // $ExpectType number
}
24 changes: 24 additions & 0 deletions float32/pi/examples/index.js
Original file line number Diff line number Diff line change
@@ -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_PI = require( './../lib' );

console.log( FLOAT32_PI );
// => 3.1415927410125732
27 changes: 27 additions & 0 deletions float32/pi/include/stdlib/constants/float32/pi.h
Original file line number Diff line number Diff line change
@@ -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_PI_H
#define STDLIB_CONSTANTS_FLOAT32_PI_H

/**
* Macro for the mathematical constant π.
*/
#define STDLIB_CONSTANT_FLOAT32_PI 3.141592653589793f

#endif // !STDLIB_CONSTANTS_FLOAT32_PI_H
52 changes: 52 additions & 0 deletions float32/pi/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* @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';

/**
* The mathematical constant `π`.
*
* @module @stdlib/constants/float32/pi
* @type {number}
*
* @example
* var FLOAT32_PI = require( '@stdlib/constants/float32/pi' );
* // returns 3.1415927410125732
*/

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );


// MAIN //

/**
* The mathematical constant `π`.
*
* @constant
* @type {number}
* @default 3.1415927410125732
* @see [Wikipedia]{@link https://en.wikipedia.org/wiki/Pi}
*/
var FLOAT32_PI = float64ToFloat32( 3.141592653589793 );


// EXPORTS //

module.exports = FLOAT32_PI;
36 changes: 36 additions & 0 deletions float32/pi/manifest.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}
Loading

0 comments on commit 9223dc1

Please sign in to comment.