-
Notifications
You must be signed in to change notification settings - Fork 3
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
Unexpected behaviour in for loop #12
Comments
In case it's of any help, the first number is the same as what I get in R, viz. > library(gsw)
> options(digits=16)
> for (i in 1:10)
+ print(gsw_p_from_z(-780.0,32.0))
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217
[1] 786.9634207624217 |
Yes, the output you show is what I'd expect in Julia as well. |
Thanks @thomasfrederikse and @dankelley. Please try master branch (through pkg>update GibbsSeaWater#master). |
Thanks @kouketsu! Just updated the code, and now I get the correct results. Again, thanks for the quick fix! |
@kouketsu should we make a new release? |
@Alexander-Barth yes. |
I got some unexpected outcomes while running GSW-julia inside a for loop. If I run the same GSW function with the same input arguments consecutively, the results change between iterations.
A minimal working example that produces the unexpected behaviour:
I expected that on every line the right answer 786.9634207624217 would be printed, but I get as output:
786.9634207624217
786.9634207624217
1821.1936700582019
1821.1990180813314
1821.1990181089222
1821.1990181089227
1821.1990181089227
1821.1990181089227
1821.1990181089227
1821.1990181089227
I'm using GibbsSeaWater.jl version 0.10.0 on Julia 1.4.1. This behavior is not limited to 'gsw_p_from_z', but occurs in other functions as well.
The text was updated successfully, but these errors were encountered: