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

Multiply ints without arithmetic/bitwise operators #144

Open
wzhouwzhou opened this issue Oct 27, 2018 · 5 comments
Open

Multiply ints without arithmetic/bitwise operators #144

wzhouwzhou opened this issue Oct 27, 2018 · 5 comments
Labels
hacktoberfest-accepted Hacktoberfest! help wanted Extra attention is needed question Further information is requested suggestion Suggest changes to this repository

Comments

@wzhouwzhou
Copy link
Owner

wzhouwzhou commented Oct 27, 2018

#1 solves this problem:

I have two variables a and b containing ints i want to multiply
the task is to make a one-line function in js that multiplies these numbers without any arithmetic/bitwise operators
ie use of + - = | & >> * / etc

Do other people have solutions, perhaps in other languages, that accomplish this?

@wzhouwzhou wzhouwzhou added help wanted Extra attention is needed question Further information is requested hacktoberfest-accepted Hacktoberfest! suggestion Suggest changes to this repository labels Oct 27, 2018
@devarakondapranav
Copy link
Contributor

@akshayrpatel
Copy link

@devarakondapranav @wzhouwzhou doesn't len() use the '+' operator?

@wzhouwzhou
Copy link
Owner Author

@akshayrpatel Technically yes, but it's a built-in so I don't really count + in builtins
The solution in #1 relies on <String>#repeat which at its core also uses + in it's description here

@igemnace
Copy link
Contributor

A Vim script solution with the same approach: #215.

@wzhouwzhou
Copy link
Owner Author

Nice, I'll look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest! help wanted Extra attention is needed question Further information is requested suggestion Suggest changes to this repository
Projects
None yet
Development

No branches or pull requests

4 participants