Closed
Description
Description
This RFC proposes adding JS implementation equivalent to sign
present in Fortran. This is used often in LAPACK/BLAS packages.
/**
* Returns `x` multipled by `signum( y )`.
*
* @param {number} x - scalar element
* @param {number} y - scalar element
* @returns {number} computed value
*
* @example
* var out = sign( 1.0, -0.9 );
* // out => -1.0
*/
function sign( x, y ) {
return x * signum( y );
}
Where we already have implementation for signum
alias: @stdlib/math/base/special/sign
reference: @stdlib/math/base/special/max
Related Issues
Related issues #2464.
Questions
No.
Other
cc @kgryte
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:
.
Metadata
Metadata
Assignees
Labels
Issue or pull requests related to "low-level" functionality oriented toward library consumers.Issue involves or relates to C.Issue or pull request for adding a new feature.Issue involves or relates to JavaScript.Issue or pull request specific to math functionality.Issue involves or relates to Node.js native add-ons.Low degree of difficulty. Should be straightforward to implement and/or resolve.High priority concern or feature request.