Skip to content

Conversation

@Neerajpathak07
Copy link
Member

@Neerajpathak07 Neerajpathak07 commented Jan 6, 2026

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Adds H_H macro in math/base/napi/unary

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • none

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jan 6, 2026
@Neerajpathak07 Neerajpathak07 added Native Addons Issue involves or relates to Node.js native add-ons. C Issue involves or relates to C. labels Jan 6, 2026
@Neerajpathak07 Neerajpathak07 changed the title feat: add H_H macro in math/base/napi/unary feat: add H_H macro in math/base/napi/unary Jan 6, 2026
Comment on lines +555 to +563
#include "stdlib/number/float64/base/to_float16.h"
#include "stdlib/number/float16/base/to_float64.h"
#include "stdlib/number/float16/ctor.h"
static stdlib_float16_t scale( const stdlib_float16_t x ) {
double y = stdlib_base_float16_to_float64( x );
y *= 10.0;
return stdlib_base_float64_to_float16( y );
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored scale fcn to adhere to float16 as prev:-

static double scale( const double x ) {
    return x * 10.0;
}

#ifndef STDLIB_MATH_BASE_NAPI_UNARY_H_H_H
#define STDLIB_MATH_BASE_NAPI_UNARY_H_H_H

#include "stdlib/number/float16/ctor.h"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why CI is failing for this header,
ref:- https://github.com/stdlib-js/stdlib/actions/runs/20740182522/job/59545266614

@Neerajpathak07 Neerajpathak07 marked this pull request as ready for review January 6, 2026 06:32
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jan 6, 2026
@Neerajpathak07 Neerajpathak07 requested a review from kgryte January 6, 2026 06:32
Signed-off-by: Neeraj Pathak <neerajrpathak710@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Issue involves or relates to C. Math Issue or pull request specific to math functionality. Native Addons Issue involves or relates to Node.js native add-ons. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants