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

Incorrect double.pow for large exponents #449

Closed
ghost opened this issue Nov 15, 2011 · 5 comments
Closed

Incorrect double.pow for large exponents #449

ghost opened this issue Nov 15, 2011 · 5 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@ghost
Copy link

ghost commented Nov 15, 2011

LibTest/core/Math/pow/Math/pow/A11/t01
LibTest/core/Math/pow/Math/pow/A13/t01

@ghost
Copy link
Author

ghost commented Nov 15, 2011

And for NaN:
LibTest/core/Math/pow/Math/pow/A18/t01

@iposva-google
Copy link
Contributor

Added Accepted label.

@ghost
Copy link
Author

ghost commented Mar 2, 2012

I think that several tests are flawed. Evaluating if co19 issues should be filed.

LibTest/core/Math/pow/Math/pow/A11/t01


This test is wrong since it exceeds double precision:

Expect.equals(double.NEGATIVE_INFINITY, Math.pow(-.0, -9223372036854775809.0))

Javascript disagrees with this expected results, should we also?

Expect.equals(double.NEGATIVE_INFINITY, Math.pow(-.0, -1.001));

LibTest/core/Math/pow/Math/pow/A13/t01


All tests expect NaN instead of 1 in cases like Math.pow(1, double.INFINITY).

LibTest/core/Math/pow/Math/pow/A18/t01 is fixed.


Remaining issue is that there is not Bigint Math.pow version to handle:

Expect.equals(double.NEGATIVE_INFINITY, Math.pow(-.0, -9223372036854775809));


cc @floitschG.

@floitschG
Copy link
Contributor

Definitely agree with A11/01 and -9223372036854775809.0. Exceeds double-precision and the closest number is actually even.

I would be ok with saying that Math.pow transforms both arguments to double if one of them is a double.
That still requires a bigint version for Math.pow on integers, but in your example I would simply return Math.pow(-.0, -9223372036854775809.0).

@ghost
Copy link
Author

ghost commented Aug 31, 2012

The math libraries have been moved and pow has been implemented even for bigints (tested).


Added Fixed label.

@ghost ghost added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Aug 31, 2012
@ghost ghost self-assigned this Aug 31, 2012
copybara-service bot pushed a commit that referenced this issue May 18, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 9669926..9145f30
 https://dart.googlesource.com/intl.git/+/9145f30 Bump actions/checkout from 2 to 3 (#462)
 https://dart.googlesource.com/intl.git/+/f545753 update the analysis_options.yaml file (#449)
 https://dart.googlesource.com/intl.git/+/fee2c2d Add a changelog entry for a recent feature (#406)
 https://dart.googlesource.com/intl.git/+/4e37662 GitHub Sync (#405)
 https://dart.googlesource.com/intl.git/+/0a14483 Bump dart-lang/setup-dart from 0.3 to 1 (#403)
 https://dart.googlesource.com/intl.git/+/f22f7b5 fix directive sorting
 https://dart.googlesource.com/intl.git/+/ed2fbe0 Add dependabot
 https://dart.googlesource.com/intl.git/+/2518923 Merge pull request #377 from dart-lang/franklinyow-patch-1
 https://dart.googlesource.com/intl.git/+/bee0456 Update LICENSE
 https://dart.googlesource.com/intl.git/+/9bb4bcc Migrating to dart:ffi in Dart 2.12.
 https://dart.googlesource.com/intl.git/+/532a1e3 Migrating to `dart:ffi` in Dart 2.12 and `package:ffi` 1.0.0.
 https://dart.googlesource.com/intl.git/+/458129d Replace git dependencies with published versions
 https://dart.googlesource.com/intl.git/+/5fd7a11 COPYBARA CHANGE FOR dart-archive/intl#358
 https://dart.googlesource.com/intl.git/+/2c8e014 Fix typo; see https://screenshot.googleplex.com/5afwL4iQtHeJKLC
 https://dart.googlesource.com/intl.git/+/33251e0 Prepare to publish for stable null safety (#362)
 https://dart.googlesource.com/intl.git/+/b3da438 Prep release for beta (#338)
 https://dart.googlesource.com/intl.git/+/48675cf Prepare a version of intl that supports the 2.12 sdk

```

Diff: https://dart.googlesource.com/intl.git/+/9669926609e7efc17dfd74fbb44ec719a7e573cc~..9145f308f1458f37630a1ffce3b7d3b471ebbc56/
Change-Id: Ic431da0e0785bd4ece86542fae30aad55f384f50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245222
Commit-Queue: Devon Carew <[email protected]>
Reviewed-by: Nate Bosch <[email protected]>
copybara-service bot pushed a commit that referenced this issue Sep 21, 2022
Changes:
```
> git log --format="%C(auto) %h %s" 32a9450..87e4c68
 https://dart.googlesource.com/markdown.git/+/87e4c68 Bump to 6.0.1 (#462)
 https://dart.googlesource.com/markdown.git/+/37305cf Add deprecated accessors for indicatorForUncheckedCheckBox and indicatorForCheckedCheckBox (#459)
 https://dart.googlesource.com/markdown.git/+/2e5e347 lint cleanup (#456)
 https://dart.googlesource.com/markdown.git/+/a0b5a05 example: small tweak to example – add Dart code (#455)
 https://dart.googlesource.com/markdown.git/+/de32a69 visitText to use textContent getter so subclassing Text class works correctly. (#431)
 https://dart.googlesource.com/markdown.git/+/8247955 Rewrite checkbox(task list) extension (#450)
 https://dart.googlesource.com/markdown.git/+/a602760 Fix crash with mixed checkbox lists (#449)

```

Diff: https://dart.googlesource.com/markdown.git/+/32a94505ded3863b82310b86344a003a19c00341~..87e4c689342d5bbaa84ba2999abf0bff503979be/
Change-Id: I92cf05fe6057e1b3eda8da09fc4eac4f67dd47ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260441
Reviewed-by: Samuel Rawlins <[email protected]>
Auto-Submit: Devon Carew <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants