-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
use parse for BigFloat/BigInt #10955
Conversation
7083848
to
7a25a87
Compare
Nice. Could we also extend the big function so we can write big("0.1") ? I am constantly writing this... |
@@ -529,3 +529,6 @@ export float32_isvalid, float64_isvalid | |||
@deprecate parseint(T::Type, s, base) parse(T, s, base) | |||
|
|||
@deprecate linrange linspace | |||
|
|||
@deprecate BigFloat(s::AbstractString) parse(BigFloat,AbstractString) | |||
@deprecate BigInt(s::AbstractString) parse(BigInt,AbstractString) |
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.
should these be
@deprecate BigFloat(s::AbstractString) parse(BigFloat,s)
@deprecate BigInt(s::AbstractString) parse(BigInt,s)
?
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.
Good catch, thanks!
7a25a87
to
d9a9cc4
Compare
I've made it a string macro, so you can write
Is that sufficient, or would a function be useful as well? |
Okay, I've replaced [pao: |
LGTM. @JeffBezanson? |
use parse for BigFloat/BigInt
Fixes deprecation warnings from JuliaLang/julia#10955
Small inconsistency: |
Ah, good point: I was just exposing the GMP/MPFR functionality. Our |
For some Int they do, |
Ah, good point. We should expose this then. |
Fixes deprecation warnings from JuliaLang/julia#10955
This deprecates
BigInt/BigFloat(::AbstractString)
methods, in favour ofparse
(see #10594 and #10599 ).big_str
andbigfloat_str
macros (analogous to thebigint_str
macro): on that note, would these be better asBigFloat_str
andBigInt_str
?parse(BigFloat,)
to0
: this is basically the same as10
, but allows for use of0x
/0b
prefixes for hex-float/bit-float (RFC: bit-float literal #9371) formats.