Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@stdlib/complex-parse-float64
Advanced tools
Parse a string representation of a 128-bit complex number.
We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Parse a string representation of a 128-bit complex number.
npm install @stdlib/complex-parse-float64
var parseComplex128 = require( '@stdlib/complex-parse-float64' );
Parse a string representation of a 128-bit complex number.
var real = require( '@stdlib/complex-real' );
var imag = require( '@stdlib/complex-imag' );
var str = '5 + 3i';
var z = parseComplex128( str );
// returns <Complex128>
var re = real( z );
// returns 5.0
var im = imag( z );
// returns 3.0
For details on the string format, see Complex128.
var parseComplex128 = require( '@stdlib/complex-parse-float64' );
var isComplex128 = require( '@stdlib/assert-is-complex128' );
var real = require( '@stdlib/complex-real' );
var imag = require( '@stdlib/complex-imag' );
var str = '1e3 - 2.75i';
var z = parseComplex128( str );
var bool = isComplex128( z );
// returns true
bool = ( real( z ) === 1e3 );
// returns true
bool = ( imag( z ) === -2.75 );
// returns true
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2024. The Stdlib Authors.
FAQs
Parse a string representation of a 128-bit complex number.
The npm package @stdlib/complex-parse-float64 receives a total of 2 weekly downloads. As such, @stdlib/complex-parse-float64 popularity was classified as not popular.
We found that @stdlib/complex-parse-float64 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.