feat: add number/float16/base/add#9442
feat: add number/float16/base/add#9442Neerajpathak07 wants to merge 18 commits intostdlib-js:developfrom
number/float16/base/add#9442Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Neeraj Pathak <neerajrpathak710@gmail.com>
|
/stdlib update-copyright-years |
|
@gururaj1512 Thanks for reviewing and flagging changes although I do have a few conflicting opinions on the description of examples!! |
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
| t = tic(); | ||
| for ( i = 0; i < ITERATIONS; i++ ) { | ||
| z = stdlib_base_float16_add( x[ i%100 ], y[ i%100 ] ); | ||
| if ( z != z ) { |
There was a problem hiding this comment.
This won't work the way you need it to. You need to compare against the bit sequence value for NaN. We do this in other benchmarks for float16.
There was a problem hiding this comment.
Better would be to use the eventual number/float16/base/assert/is-nan utility here.
There was a problem hiding this comment.
@kgryte Interesting, some of the upstream versions that I referred to such as number/float16/base/from-word, significand & to-float64. What I realized is that the JS implementation utilizes isnan() but commonly for the C benchmark we are adapting the antique if( out != out ) check.
Maybe this can we updated from here on, to utilize the nan check directly from the utilities we'll need add a C header for float16/base/assert/is-nan. If you green light this I'll get going.
There was a problem hiding this comment.
It depends on the package. The reason I recommended using the utility here is that float16 is special. So it is entirely a case-by-case basis. The TL;DR is that you need to think more deeply about what is being compared and whether it is applicable.
There was a problem hiding this comment.
Yeah, makes more sense!!!
|
Will draft this PR for the time being till we add the macro and the utilities!! |
Resolves none.
Description
This pull request:
number/float16/base/addRelated Issues
This pull request has the following related issues:
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