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
Support dist^integer for negative values #2235
Conversation
🦋 Changeset detectedLatest commit: 3254b77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Ignored Deployments
|
Codecov Report
@@ Coverage Diff @@
## main #2235 +/- ##
==========================================
+ Coverage 72.90% 73.04% +0.14%
==========================================
Files 107 107
Lines 5347 5349 +2
Branches 1008 1026 +18
==========================================
+ Hits 3898 3907 +9
+ Misses 1442 1434 -8
- Partials 7 8 +1 |
Huh, it doesn't fail, but the output doesn't look correct either: https://squiggle-website-git-complex-erro-08a1ca-quantified-uncertainty.vercel.app/playground#code=eNqrVkpJTUsszSlxzk9JVbJSyssvyk3M0TDQMdRUiFMwUtJRKs7ILw8uzc1NLKpUsiopKk2tBQDGohFr This looks like rendering issue, because samples bar is fine, so probably log KDE? |
// ok when power is integer | ||
testEvalToBe("normal(-100, 1) ^ 2", "Sample Set Distribution"); | ||
// fails when power is not an integer | ||
testEvalToBe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why this fails when it's not an integer? It works fine in the JS console. (3 ** 2.3
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fails when base is negative, which shouldn't be surprising; consider (-1) ^ 0.5
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense
|
Fixes #2052.
normal(-100, 1) ^ 2
-> oknormal(-100, 1) ^ 2.5
-> complex number error