feat: add lapack/base/disnan#12289
Conversation
| // TypeScript Version: 4.1 | ||
|
|
||
| /** | ||
| * Tests a double-precision floating-point numeric value for NaN. |
There was a problem hiding this comment.
| * Tests a double-precision floating-point numeric value for NaN. | |
| * Tests whether a double-precision floating-point number is NaN. |
| /** | ||
| * Tests a double-precision floating-point numeric value for NaN. | ||
| * | ||
| * @param DIN - double-precision floating-point number to test |
There was a problem hiding this comment.
| * @param DIN - double-precision floating-point number to test | |
| * @param x - input value |
| * Tests a double-precision floating-point numeric value for NaN. | ||
| * | ||
| * @param DIN - double-precision floating-point number to test | ||
| * @returns boolean indicating whether the value is NaN |
There was a problem hiding this comment.
| * @returns boolean indicating whether the value is NaN | |
| * @returns boolean indicating whether an input value is NaN |
| * var bool = disnan( 5.0 ); | ||
| * // returns false | ||
| */ | ||
| declare function disnan( DIN: number ): boolean; |
There was a problem hiding this comment.
| declare function disnan( DIN: number ): boolean; | |
| declare function disnan( x: number ): boolean; |
Use normal JavaScript parameter names.
| @@ -0,0 +1,24 @@ | |||
|
|
|||
| {{alias}}( din ) | |||
| 'use strict'; | ||
|
|
||
| /** | ||
| * LAPACK auxiliary routine to test a double-precision floating-point numeric value for NaN. |
There was a problem hiding this comment.
| * LAPACK auxiliary routine to test a double-precision floating-point numeric value for NaN. | |
| * LAPACK auxiliary routine to test whether a double-precision floating-point number is NaN. |
| * ## Notes | ||
| * | ||
| * - This routine uses `dlaisnan` to test for `NaN` by comparing the argument against itself for inequality. | ||
| * |
There was a problem hiding this comment.
| * ## Notes | |
| * | |
| * - This routine uses `dlaisnan` to test for `NaN` by comparing the argument against itself for inequality. | |
| * |
Coverage Report
The above coverage report was generated for the changes in this PR. |
| // MAIN // | ||
|
|
||
| /** | ||
| * Tests a double-precision floating-point numeric value for NaN. |
| { | ||
| "name": "@stdlib/lapack/base/disnan", | ||
| "version": "0.0.0", | ||
| "description": "LAPACK auxiliary routine to test a double-precision floating-point numeric value for NaN.", |
There was a problem hiding this comment.
| "description": "LAPACK auxiliary routine to test a double-precision floating-point numeric value for NaN.", | |
| "description": "LAPACK auxiliary routine to test whether a double-precision floating-point number is NaN.", |
|
|
||
| # disnan | ||
|
|
||
| > LAPACK auxiliary routine to test a double-precision floating-point numeric value for `NaN`. |
There was a problem hiding this comment.
| > LAPACK auxiliary routine to test a double-precision floating-point numeric value for `NaN`. | |
| > LAPACK auxiliary routine to test whether a double-precision floating-point number is `NaN`. |
| var disnan = require( '@stdlib/lapack/base/disnan' ); | ||
| ``` | ||
|
|
||
| #### disnan( din ) |
| ## Notes | ||
|
|
||
| - `disnan()` corresponds to the [LAPACK][lapack] auxiliary routine [`disnan`][lapack-disnan]. | ||
| - `disnan` tests for `NaN` by internally calling [`dlaisnan`][lapack-dlaisnan] with the same argument passed twice (i.e., `dlaisnan( din, din )`). This approach avoids issues with compiler optimization that might incorrectly evaluate `NaN !== NaN` as `false`. |
There was a problem hiding this comment.
| - `disnan` tests for `NaN` by internally calling [`dlaisnan`][lapack-dlaisnan] with the same argument passed twice (i.e., `dlaisnan( din, din )`). This approach avoids issues with compiler optimization that might incorrectly evaluate `NaN !== NaN` as `false`. |
This info isn't super relevant for the average user.
kgryte
left a comment
There was a problem hiding this comment.
Similar to dlaisnan, I am not convinced that this package is particularly relevant/necessary for our JavaScript implementations where we can (and likely should) just use math/base/assert/is-nan. It becomes more relevant for the C and Fortran implementations.
Left a number of initial comments.
Resolves none.
Description
This pull request:
lapack/base/disnanRelated Issues
This pull request has the following related issues:
lapack/base/dlaisnan#12183 to be merged.Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers