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

[Feature Request] Add an Exponentiation Operator #10257

Closed
DartBot opened this issue Apr 27, 2013 · 6 comments
Closed

[Feature Request] Add an Exponentiation Operator #10257

DartBot opened this issue Apr 27, 2013 · 6 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report

Comments

@DartBot
Copy link

DartBot commented Apr 27, 2013

This issue was originally filed by reeves....@gmail.com


Add a built-in exponentiation operator to Dart.

It could look like Python's ** operator.

This will contribute to the readability of Dart and the furtherance of its goals to be 'simple' and 'familiar'.

After all, you don't have to say, "multiply(x, y)" to multiply two numbers. Why should I have to say "pow(x, y)"? This is verbose, contrary to Dart's goals, and inconsistent with related Dart syntax.

@kasperl
Copy link

kasperl commented Apr 29, 2013

Added Area-Language, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Apr 30, 2013

This comment was originally written by incr...@gmail.com


The exponential operator may be good idea (I'm not against it), but arguments that have been mentioned in the request are not relevant. Which favorite math function will deserve to have its own operator and which not?

@DartBot
Copy link
Author

DartBot commented Apr 30, 2013

This comment was originally written by reeves.r...@gmail.com


To answer your question, pow() is the only math function that is lacking its own operator because it's the last commonly used mathematical hyperoperator without one.

Dart has an operator for the first 3 hyperoperators: successor (++), addition(+), and multiplication (*), but arbitrarily lacks the 4th (an exponentiation operator) which would be last operator needed by nearly any programmer.

@DartBot
Copy link
Author

DartBot commented May 6, 2013

This comment was originally written by mario.p...@gmail.com


If exponentiation gets its own operator, shouldn't the complementing operation (taking the n-th root) get an operator, too?

@DartBot
Copy link
Author

DartBot commented May 6, 2013

This comment was originally written by mario.plon...@gmail.com


Also, duplicate: https://code.google.com/p/dart/issues/detail?id=1859

@kevmoo
Copy link
Member

kevmoo commented Apr 5, 2014

Added Duplicate label.
Marked as being merged into #1859.

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Apr 5, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

3 participants