-
-
Notifications
You must be signed in to change notification settings - Fork 848
Closed
Labels
BaseIssue or pull requests related to "low-level" functionality oriented toward library consumers.Issue or pull requests related to "low-level" functionality oriented toward library consumers.CIssue involves or relates to C.Issue involves or relates to C.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.MathIssue or pull request specific to math functionality.Issue or pull request specific to math functionality.Native AddonsIssue involves or relates to Node.js native add-ons.Issue involves or relates to Node.js native add-ons.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: HighHigh priority concern or feature request.High priority concern or feature request.
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
BaseIssue or pull requests related to "low-level" functionality oriented toward library consumers.Issue or pull requests related to "low-level" functionality oriented toward library consumers.CIssue involves or relates to C.Issue involves or relates to C.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.MathIssue or pull request specific to math functionality.Issue or pull request specific to math functionality.Native AddonsIssue involves or relates to Node.js native add-ons.Issue involves or relates to Node.js native add-ons.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: HighHigh priority concern or feature request.High priority concern or feature request.