-
Notifications
You must be signed in to change notification settings - Fork 10
Stochasically round on conversions from larger types #82
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
base: main
Are you sure you want to change the base?
Conversation
|
@milankl Thanks for this nice package. I am researching in the area of numerical analysis with stochastic floats and kind of need this small presented feature :) I think it just needs a change in the few lines. Test are fine locally. Why are the tests not triggered in this PR? I can have a look if you want :) edit: Workflow needs approval. This just popped up. |
|
Awesome, thank you!! Will review after CI passes 🥳 |
|
Would you mind adding some tests to verify that this is actually the case?
|
|
Sorry for the late answer. I will add tests and investigate the failure on 1.11. |
|
Testing is not so trivial with non-deterministic values :) I think
is not in the scope of this package.
this is already done in the tests. I adjusted the name of the testsets.
this is now implemented. I check 10000 times that the result differs at least once for 100 random numbers :)
I am not sure what to test. The same test as above with |
b222653 to
717adaf
Compare
test/conversions.jl
Outdated
| end | ||
| end | ||
|
|
||
| @test is_stochastic == true |
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.
No need to check that a boolean is equal to another boolean, you can just test its boolean value 🙂
| @test is_stochastic == true | |
| @test is_stochastic |
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.
Yes, I know. I found it more readable as a user in this particular scenario.
A failing test is more semantic since we get the message
Expression: is_stochastic == true
Evaluated: false == true
instead of
Expression: is_stochastic
I think it is better in the first variant.
But I can change it to the second one if you want.
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.
no need, that's fine by me and I agree with your point
717adaf to
59929da
Compare
|
Just saw https://pretalx.com/juliacon-local-paris-2025/talk/UDQLTD/. Very nice, thanks for talking about this! Sorry I can have a look at this pull request next week and merge. Feel free to ping me in case I forget |
|
Hey there! I was on vacation until today :) so, ping? I was looking for an interesting topic for the JuliaCon and your package applied to our PDE solvers seemed perfect :) |
|
This still fails at v1.11 you mind retriggering the CI? |
|
I added a small commit. But I cannot start or restart CI. |
This resolves #79
This enables the missing stochastic rounding calls on both deterministic and stochastic input.