-
Notifications
You must be signed in to change notification settings - Fork 23
Update calls to round, change signif to round #56
Conversation
The failure on nightly is caused by another bug introduced by the same change JuliaLang/julia#26670, that will need to be fixed in base. |
Thanks for merging this! |
# BigFloat and DecFP (at least) on master | ||
|
||
@static if VERSION >= v"0.7.0-DEV.4804" | ||
# adapted from Matlab File Exchange roundsd: http://www.mathworks.com/matlabcentral/fileexchange/26212 |
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 not use the Matlab file exchange. While the original author is required to license their work as BSD, by downloading it from the file exchange you're agreeing to this additional clause in their terms of use:
Content submitted to File Exchange may only be used with MathWorks products.
Besides that, a URL in source code does not satisfy the terms of the BSD license for the original author — that copyright notice should be added or linked to in the LICENSE.
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.
That was taken directly from Julia base/floatfunctions.jl (in v0.6.x).
If there is a problem with Julia base, then it should be corrected there as well.
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, indeed. Thanks!
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.
As soon as it is fixed in base (and hopefully supported by Compat.jl), this can be changed to simply call the new form, i.e. round(ax; sigdig=fs.prec + 1)
.
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, glad to see it's being removed. The biggest thing is actually the ToU violation for the person that actually downloaded it, but even then that clause isn't very clear. I just try to stay away from the file exchange, personally.
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.
Yep - good advice (to stay away from MathWorks).
I hadn't thought about it, since I'd assumed that things in Base had been well vetted.
(and you know what happens when you assume anything!)
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.
I found the original change - and it's an ancient one! 5.5 years old, from Sept. 4, 2012 (JuliaLang/julia@4c88c22) by HarlanH, committed by Stefan.
Not sure if the violation is considered to be by the person who made the PR, or the person who actually placed it into the Julia source code against the ToU.
Fixes BigFloat digit rounding (JuliaIO/Formatting.jl#56). I've also tweaked the definitions to make it easier to extend to new number formats.
Fixes BigFloat digit rounding (JuliaIO/Formatting.jl#56). I've also tweaked the definitions to make it easier to extend to new number formats.
No description provided.