Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stdlib/math-base-special-sin

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/math-base-special-sin - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

include/stdlib/math/base/special/sin.h

6

dist/index.js

@@ -1,6 +0,6 @@

"use strict";var v=function(i,r){return function(){return r||i((r={exports:{}}).exports,r),r.exports}};var s=v(function(O,n){
var c=require('@stdlib/constants-float64-high-word-abs-mask/dist'),f=require('@stdlib/constants-float64-high-word-exponent-mask/dist'),q=require('@stdlib/number-float64-base-get-high-word/dist'),t=require('@stdlib/math-base-special-kernel-cos/dist'),a=require('@stdlib/math-base-special-kernel-sin/dist'),o=require('@stdlib/math-base-special-rempio2/dist'),_=1072243195,H=1045430272,e=[0,0];function S(i){var r,u;if(r=q(i),r&=c,r<=_)return r<H?i:a(i,0);if(r>=f)return NaN;switch(u=o(i,e),u&3){case 0:return a(e[0],e[1]);case 1:return t(e[0],e[1]);case 2:return-a(e[0],e[1]);default:return-t(e[0],e[1])}}n.exports=S
});var A=s();module.exports=A;
"use strict";var v=function(i,r){return function(){return r||i((r={exports:{}}).exports,r),r.exports}};var s=v(function(W,n){
var _=require('@stdlib/constants-float64-high-word-abs-mask/dist'),H=require('@stdlib/constants-float64-high-word-exponent-mask/dist'),c=require('@stdlib/number-float64-base-get-high-word/dist'),t=require('@stdlib/math-base-special-kernel-cos/dist'),a=require('@stdlib/math-base-special-kernel-sin/dist'),f=require('@stdlib/math-base-special-rempio2/dist'),q=1072243195,o=1045430272,e=[0,0];function O(i){var r,u;if(r=c(i),r&=_,r<=q)return r<o?i:a(i,0);if(r>=H)return NaN;switch(u=f(i,e),u&3){case 0:return a(e[0],e[1]);case 1:return t(e[0],e[1]);case 2:return-a(e[0],e[1]);default:return-t(e[0],e[1])}}n.exports=O
});var I=s();module.exports=I;
/** @license Apache-2.0 */
/** @license Apache-2.0 */
//# sourceMappingURL=index.js.map

@@ -37,4 +37,4 @@ /**

var ABS_MASK = require( '@stdlib/constants-float64-high-word-abs-mask' );
var EXPONENT_MASK = require( '@stdlib/constants-float64-high-word-exponent-mask' );
var HIGH_WORD_ABS_MASK = require( '@stdlib/constants-float64-high-word-abs-mask' );
var HIGH_WORD_EXPONENT_MASK = require( '@stdlib/constants-float64-high-word-exponent-mask' );
var getHighWord = require( '@stdlib/number-float64-base-get-high-word' );

@@ -102,3 +102,3 @@ var kernelCos = require( '@stdlib/math-base-special-kernel-cos' );

ix = getHighWord( x );
ix &= ABS_MASK;
ix &= HIGH_WORD_ABS_MASK;

@@ -114,3 +114,3 @@ // Case: |x| ~< π/4

// Case: x is NaN or infinity
if ( ix >= EXPONENT_MASK ) {
if ( ix >= HIGH_WORD_EXPONENT_MASK ) {
return NaN;

@@ -117,0 +117,0 @@ }

{
"name": "@stdlib/math-base-special-sin",
"version": "0.2.1",
"version": "0.3.0",
"description": "Compute the sine of a number.",

@@ -17,5 +17,8 @@ "license": "Apache-2.0",

"main": "./lib",
"gypfile": false,
"directories": {
"doc": "./docs",
"include": "./include",
"lib": "./lib",
"src": "./src",
"dist": "./dist"

@@ -34,8 +37,10 @@ },

"dependencies": {
"@stdlib/constants-float64-high-word-abs-mask": "^0.2.1",
"@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1",
"@stdlib/math-base-special-kernel-cos": "^0.2.1",
"@stdlib/math-base-special-kernel-sin": "^0.2.1",
"@stdlib/constants-float64-high-word-abs-mask": "^0.2.2",
"@stdlib/constants-float64-high-word-exponent-mask": "^0.2.2",
"@stdlib/math-base-napi-unary": "^0.2.3",
"@stdlib/math-base-special-kernel-cos": "^0.2.3",
"@stdlib/math-base-special-kernel-sin": "^0.2.3",
"@stdlib/math-base-special-rempio2": "^0.2.1",
"@stdlib/number-float64-base-get-high-word": "^0.2.1"
"@stdlib/number-float64-base-get-high-word": "^0.2.2",
"@stdlib/utils-library-manifest": "^0.2.2"
},

@@ -42,0 +47,0 @@ "devDependencies": {},

@@ -98,2 +98,87 @@ <!--

<!-- 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/math/base/special/sin.h"
```
#### stdlib_base_sin( x )
Computes the [sine][sine] of a `number` (in radians).
```c
double y = stdlib_base_sin( 3.141592653589793 / 2.0 );
// returns ~1.0
```
The function accepts the following arguments:
- **x**: `[in] double` input value.
```c
double stdlib_base_sin( const double x );
```
</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 -->
<!-- C API usage examples. -->
<section class="examples">
### Examples
```c
#include "stdlib/math/base/special/sin.h"
#include <stdio.h>
int main( void ) {
const double x[] = { 0.0, 0.523, 0.785, 1.047, 3.14 };
double y;
int i;
for ( i = 0; i < 5; i++ ) {
y = stdlib_base_sin( x[ i ] );
printf( "sin(%lf) = %lf\n", x[ i ], y );
}
}
```
</section>
<!-- /.examples -->
</section>
<!-- /.c -->
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

@@ -149,4 +234,4 @@

[test-image]: https://github.com/stdlib-js/math-base-special-sin/actions/workflows/test.yml/badge.svg?branch=v0.2.1
[test-url]: https://github.com/stdlib-js/math-base-special-sin/actions/workflows/test.yml?query=branch:v0.2.1
[test-image]: https://github.com/stdlib-js/math-base-special-sin/actions/workflows/test.yml/badge.svg?branch=v0.3.0
[test-url]: https://github.com/stdlib-js/math-base-special-sin/actions/workflows/test.yml?query=branch:v0.3.0

@@ -153,0 +238,0 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-sin/main.svg

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc