Socket
Socket
Sign inDemoInstall

@stdlib/complex-real

Package Overview
Dependencies
69
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

include/stdlib/complex/real.h

5

docs/repl.txt
{{alias}}( z )
Returns the real component of a complex number.
Returns the real component of a double-precision complex floating-point
number.
Parameters
----------
z: Complex
z: Complex128
Complex number.

@@ -9,0 +10,0 @@

6

docs/types/index.d.ts

@@ -23,6 +23,6 @@ /*

import { ComplexLike } from '@stdlib/types/object';
import { Complex128 } from '@stdlib/types/object';
/**
* Returns the real component of a complex number.
* Returns the real component of a double-precision complex floating-point number.
*

@@ -40,3 +40,3 @@ * @param z - complex number

*/
declare function real( z: ComplexLike ): number;
declare function real( z: Complex128 ): number;

@@ -43,0 +43,0 @@

@@ -19,5 +19,4 @@ /*

import Complex128 = require( '@stdlib/complex-float64' );
import real = require( './index' );
import Complex128 = require( '@stdlib/complex-float64' );
import Complex64 = require( '@stdlib/complex-float32' );

@@ -30,4 +29,2 @@

real( new Complex128( 5.0, 3.0 ) ); // $ExpectType number
real( new Complex64( 5.0, 3.0 ) ); // $ExpectType number
real( { 're': 5.0, 'im': 3.0 } ); // $ExpectType number
}

@@ -34,0 +31,0 @@

@@ -22,3 +22,3 @@ /**

/**
* Return the real component of a complex number.
* Return the real component of a double-precision complex floating-point number.
*

@@ -39,3 +39,3 @@ * @module @stdlib/complex-real

var real = require( './real.js' );
var main = require( './main.js' );

@@ -45,2 +45,2 @@

module.exports = real;
module.exports = main;
{
"name": "@stdlib/complex-real",
"version": "0.0.6",
"description": "Return the real component of a complex number.",
"version": "0.0.7",
"description": "Return the real component of a double-precision complex floating-point number.",
"license": "Apache-2.0",

@@ -40,8 +40,8 @@ "author": {

"dependencies": {
"@stdlib/types": "^0.0.x"
"@stdlib/complex-float64": "^0.0.x",
"@stdlib/types": "^0.0.x",
"@stdlib/utils-library-manifest": "^0.0.x"
},
"devDependencies": {
"@stdlib/bench": "^0.0.x",
"@stdlib/complex-float32": "^0.0.x",
"@stdlib/complex-float64": "^0.0.x",
"@stdlib/math-base-assert-is-nan": "^0.0.x",

@@ -48,0 +48,0 @@ "@stdlib/math-base-special-round": "^0.0.x",

@@ -23,5 +23,5 @@ <!--

[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
> Return the real component of a complex number.
> Return the real component of a double-precision complex floating-point number.

@@ -58,3 +58,3 @@ <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

Returns the **real** component of a `complex` number.
Returns the **real** component of a double-precision complex floating-point number.

@@ -112,2 +112,97 @@ ```javascript

<!-- 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/complex/real.h"
```
#### stdlib_real( z )
Returns the real component of a double-precision complex floating-point number.
```c
#include "stdlib/complex/float64.h"
stdlib_complex128_t z = stdlib_complex128( 5.0, 2.0 );
// ...
double re = stdlib_real( z );
// returns 5.0
```
The function accepts the following arguments:
- **z**: `[in] stdlib_complex128_t` double-precision complex floating-point number.
```c
double stdlib_real( const stdlib_complex128_t z );
```
</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/complex/real.h"
#include "stdlib/complex/float64.h"
#include <stdio.h>
int main() {
stdlib_complex128_t x[] = {
stdlib_complex128( 5.0, 2.0 ),
stdlib_complex128( -2.0, 1.0 ),
stdlib_complex128( 0.0, -0.0 ),
stdlib_complex128( 0.0/0.0, 0.0/0.0 )
};
int i;
for ( i = 0; i < 4; i++ ) {
printf( "real(v) = %lf\n", stdlib_real( x[ i ] ) );
}
}
```
</section>
<!-- /.examples -->
</section>
<!-- /.c -->
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

@@ -121,2 +216,17 @@

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
<section class="related">
* * *
## See Also
- <span class="package-name">[`@stdlib/complex/imag`][@stdlib/complex/imag]</span><span class="delimiter">: </span><span class="description">return the imaginary component of a complex number.</span>
- <span class="package-name">[`@stdlib/complex/reim`][@stdlib/complex/reim]</span><span class="delimiter">: </span><span class="description">return the real and imaginary components of a complex number.</span>
</section>
<!-- /.related -->
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

@@ -148,3 +258,3 @@

Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
Copyright &copy; 2016-2022. The Stdlib [Authors][stdlib-authors].

@@ -168,5 +278,16 @@ </section>

<!--
[dependencies-image]: https://img.shields.io/david/stdlib-js/complex-real.svg
[dependencies-url]: https://david-dm.org/stdlib-js/complex-real/main
-->
[umd]: https://github.com/umdjs/umd
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
[deno-url]: https://github.com/stdlib-js/complex-real/tree/deno
[umd-url]: https://github.com/stdlib-js/complex-real/tree/umd
[esm-url]: https://github.com/stdlib-js/complex-real/tree/esm
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg

@@ -181,4 +302,12 @@ [chat-url]: https://gitter.im/stdlib-js/stdlib/

<!-- <related-links> -->
[@stdlib/complex/imag]: https://www.npmjs.com/package/@stdlib/complex-imag
[@stdlib/complex/reim]: https://www.npmjs.com/package/@stdlib/complex-reim
<!-- </related-links> -->
</section>
<!-- /.links -->

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc