feat: add number/float16/base/add#9442
feat: add number/float16/base/add#9442Neerajpathak07 wants to merge 13 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 |
lib/node_modules/@stdlib/number/float16/base/add/benchmark/benchmark.native.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/number/float16/base/add/examples/c/example.c
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/number/float16/base/add/examples/index.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/number/float16/base/add/test/test.native.js
Outdated
Show resolved
Hide resolved
|
@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>
lib/node_modules/@stdlib/number/float16/base/add/examples/index.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Athan <kgryte@gmail.com>
lib/node_modules/@stdlib/number/float16/base/add/benchmark/benchmark.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Athan <kgryte@gmail.com>
| double elapsed; | ||
| stdlib_float16_t z; |
There was a problem hiding this comment.
| double elapsed; | |
| stdlib_float16_t z; | |
| stdlib_float16_t z; | |
| double elapsed; |
| 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.
| ] | ||
| } | ||
| ], | ||
| "output_policy": "same", |
There was a problem hiding this comment.
| "output_policy": "same", |
We can remove this, as this particular field was later found to be unnecessary at this level.
There was a problem hiding this comment.
@Neerajpathak07 We should go ahead and add the binary macro for half-precision HH_H. Would you mind opening a PR for this?
| // MODULES // | ||
|
|
||
| var tape = require( 'tape' ); | ||
| var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); |
There was a problem hiding this comment.
We should go ahead and create a half-precision utility for this at number/float16/base/assert/is-negative-zero. Same thing for is-positive-zero and is-nan.
We'll eventually be moving math/base/assert/is-negative-zero to number/float64/base/assert/is-negative-zero, so we might as well go ahead and pre-emptively add the half-precision utilities.
There was a problem hiding this comment.
will add a PR soon for that!!
|
|
||
| var resolve = require( 'path' ).resolve; | ||
| var tape = require( 'tape' ); | ||
| var isNegativeZero = require( '@stdlib/math/base/assert/is-negative-zero' ); |
|
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