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

Add power operator #1859

Closed
DartBot opened this issue Feb 26, 2012 · 8 comments
Closed

Add power operator #1859

DartBot opened this issue Feb 26, 2012 · 8 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Feb 26, 2012

This issue was originally filed by @ahmetaa


A minor, and possibly breaking "familiarity" principle feature request.
Could it be possible to add Python's power (**) operator for representing Math.power(x,y)? Such as, x**y = Math.pow(x,y)

http://docs.python.org/release/2.5.2/ref/power.html

@iposva-google
Copy link
Contributor

Set owner to @gbracha.
Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Feb 27, 2012

Removed Type-Defect label.
Added Type-Enhancement, Accepted labels.

@gbracha
Copy link
Contributor

gbracha commented May 24, 2012

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 5, 2014

Issue #10257 has been merged into this issue.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@DartBot
Copy link
Author

DartBot commented Nov 15, 2014

This comment was originally written by matthias.ben...@gmail.com


When this is implemented, make sure to make exponentials into compile time constants. Right now pow(.5,32) is not a compile time constant. Since shifts are currently broken in dart2js for large numbers I'm resorting to multiplications instead and it really makes the code ugly that I have to pre-compute the numbers.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Nov 15, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed accepted labels Feb 29, 2016
@lrhn
Copy link
Member

lrhn commented Jun 22, 2018

I don't think an extra operator that is only really useful for numbers, is worth the syntactic footprint it requires.
A function like power could just become a member on num, so you could do 4.pow(5). Having it as external, and still working on both doubles and integers, seems unnecessary.

@lrhn lrhn closed this as completed Jun 22, 2018
@lrhn lrhn added the closed-not-planned Closed as we don't intend to take action on the reported issue label Jun 22, 2018
copybara-service bot pushed a commit that referenced this issue Jan 9, 2023
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/9ed196f..29a1bbf):
  29a1bbf8  2023-01-04  Sam Rawlins  Migrate documentation_comment_test to be reflective (#3288)

string_scanner (https://github.com/dart-lang/string_scanner/compare/6ddab2c..c58618d):
  c58618d  2023-01-06  dependabot[bot]  Bump actions/checkout from 3.2.0 to 3.3.0 (#52)

webdev (https://github.com/dart-lang/webdev/compare/8795ca5..49f97b8):
  49f97b8  2023-01-06  Parker Lougheed  Replace deprecated implicit-casts option with strict-casts option (#1863)
  940c0ee  2023-01-06  Elliott Brooks (she/her)  Set a debug key for the injected client and Dart Debug Extension SSE clients (#1872)
  ae3e2ea  2023-01-06  Elliott Brooks (she/her)  [MV3] Dart Debug Extension supports cross-extension communication with AngularDart DevTools  (#1866)
  0662af9  2023-01-06  Anna Gringauze  Fix error message on dds failure2 (#1865)
  4f62035  2023-01-06  Elliott Brooks (she/her)  Can launch embedded Dart Debugger & Flutter Inspector (#1829)
  36fa973  2023-01-05  Elliott Brooks (she/her)  Refactor `TestContext` constructor for clarity (#1844)
  57776a0  2023-01-04  Elliott Brooks (she/her)  Use latest version of `package:sse` in the MV3 Debug Extension (#1859)

Change-Id: Ib97239b4f453238572dcccb9a0f81e4f1e969a04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278683
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
copybara-service bot pushed a commit that referenced this issue Jan 24, 2023
args (https://github.com/dart-lang/args/compare/ac0e2c8..04c9346):
  04c9346  2023-01-19  Devon Carew  blast_repo fixes (#230)

async (https://github.com/dart-lang/async/compare/de1ce93..c9cc576):
  c9cc576  2023-01-23  Devon Carew  update changelog and pubspec version (#228)

intl (https://github.com/dart-lang/intl/compare/6140b60..3fcc810):
  3fcc810  2023-01-23  Copybara-Service  Merge pull request #535 from dart-lang:changeNumberOfDigitsCalculation
  07a73ca  2023-01-23  Moritz  Add license
  f0d0530  2023-01-20  Moritz  Add test
  aea7a7a  2023-01-20  Moritz  Fix bug in numberOfIntegerDigits calculation, simplifying the algorithm
  039f2b4  2023-01-20  Copybara-Service  Merge pull request #532 from dart-lang:removeTimezone
  c97ee27  2023-01-13  Moritz  Remove unimplemented timezone functionality

mockito (https://github.com/dart-lang/mockito/compare/9cc958a..7696557):
  7696557  2023-01-22  dependabot[bot]  Bump actions/checkout from 3.1.0 to 3.3.0 (#599)
  ee68765  2023-01-20  Devon Carew  generate code before we analyze (#601)
  09aabe7  2023-01-20  Sam Rawlins  GitHub Sync (#602)
  0128352  2023-01-19  Devon Carew  blast_repo fixes

test (https://github.com/dart-lang/test/compare/19582a8..53df527):
  53df5270  2023-01-23  Nate Bosch  Fix description of conditions without expectations (#1864)
  cbac7089  2023-01-23  Nate Bosch  Allow omitting the actual argument for rejections (#1861)
  af768a8f  2023-01-20  Nate Bosch  Add anyOf condition (#1859)
  387436bd  2023-01-20  Nate Bosch  Add unordered iterable comparisons (#1858)
  b3c78a4b  2023-01-19  Nate Bosch  Implement deep collection equality (#1853)
  e5a9f7d4  2023-01-19  Nate Bosch  Rename allowLateFailure -> allowUnawaited (#1854)

Change-Id: I9f82587285250f608e070d1380b836ee8238c5fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279642
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
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-not-planned Closed as we don't intend to take action on the reported issue P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants