Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: add C implementation for number/uint32/base/to-int32 #1914

Open
3 tasks done
gunjjoshi opened this issue Mar 16, 2024 · 6 comments
Open
3 tasks done

[RFC]: add C implementation for number/uint32/base/to-int32 #1914

gunjjoshi opened this issue Mar 16, 2024 · 6 comments
Labels
Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes.

Comments

@gunjjoshi
Copy link
Member

Description

This RFC proposes adding C implementation for number/uint32/base/to-int32.

This is a pre-requisite for the C implementation of stdlib/math/base/special/pow.

Related Issues

Related issues #649.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@gunjjoshi
Copy link
Member Author

What can be a suitable function signature for this ?
cc: @kgryte

@kgryte
Copy link
Member

kgryte commented Mar 16, 2024

@gunjjoshi FYI: pow is already in-flight. See #1739.

@gunjjoshi
Copy link
Member Author

Thanks for pointing this out @kgryte. We can close this issue then.

@kgryte
Copy link
Member

kgryte commented Mar 16, 2024

I'm not sure this implementation is strictly necessary atm. In C, one can simply do

uint32_t v1 = 4;

// ...

int32_t v2 = (int32_t)v1;

We added the JS package to provide a functional API for "casting", given that JS does not have static types, as in C.

Nevertheless, I think we can keep this open, but this is not high priority and we can revisit later on.

@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Needs Discussion Needs further discussion. labels Mar 16, 2024
@gunjjoshi
Copy link
Member Author

Sounds good. Thanks for explaining this.

@Akshat-Kob
Copy link

i want to work on this issue, if it has not been assigned to someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
Development

No branches or pull requests

3 participants