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

added class PrimitiveMath, that focus on performing Addition Operatio… #6982

Conversation

harishwar-babu
Copy link

Created a new class called PrimitiveMath , which has two static functionalities

  • Addition(v1,v2) --> (for integer, long,short) --> returns integer value.
  • isEven(v1) ---> (for integer,long,short) ---> returns boolean value.

Copy link

google-cla bot commented Feb 11, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@eamonnmcmanus
Copy link
Member

Please see the How to Contribute document. We generally don't accept pull requests that add a new API without prior discussion. I note too that the code in this PR doesn't build.

@harishwar-babu
Copy link
Author

harishwar-babu commented Feb 12, 2024 via email

@harishwar-babu
Copy link
Author

harishwar-babu commented Feb 12, 2024 via email

@eamonnmcmanus eamonnmcmanus self-assigned this Feb 12, 2024
@eamonnmcmanus
Copy link
Member

The document I linked to explains the process. A proposed new API starts with a new issue describing what the API looks like and what use cases it addresses.

I will say, to save everyone time, that I think it is unlikely that an API like the proposed add will be accepted. The claim that a method adding integers by using bitwise operations is faster than the native + operator is frankly astonishing. I think you would need to produce some very convincing evidence in the form of benchmarks.

There is maybe slightly more justification for isEven, but I think most people know or can find out that they can write (i & 1) == 0 or i % 2 == 0.

@harishwar-babu
Copy link
Author

harishwar-babu commented Feb 13, 2024 via email

@harishwar-babu
Copy link
Author

So, shall I attach the file about the bench marks and justification in this thread. for your reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants