Yes, I tried it. My specific question is about the Base.parser() behavior regarding integer literals:
v0.3-pre/x64 produces an Int64 when it fits, and a :(@int128_str "...") Exprwhen confronted with numbers that would overflow an Int64, but fit an Int128. v0.2/x64 chokes on numbers that overflow Int64. What about v0.2/x86 for numbers that overflow an Int32, but fit an Int64? On Friday, February 28, 2014 6:02:28 PM UTC+1, Stefan Karpinski wrote: > > We didn't backport any of the number parsing changes to 0.2.1 since those > are features. > > > On Fri, Feb 28, 2014 at 8:27 AM, Pierre-Yves Gérardy > <[email protected]<javascript:> > > wrote: > >> That approach works, at least for 64 bits CPUs. >> >> In v0.2, parse(str) will choke on number overflow and throw a ParseError. >> >> It would be nice if someone using v0.2.1 and a 32bit machine (old OS X?) >> could tell me what happens when you run this: >> >> parse("9223372036854775807") >> parse("-9223372036854775808") >> >> —Pierre-Yves >> >> >> On Friday, February 28, 2014 11:53:51 AM UTC+1, Pierre-Yves Gérardy wrote: >>> >>> Short of re-implementing parseint, is there a way to work around this? >>> >>> I was thinking of something like this (for Int64 only) >>> >>> try >>> num = parseint(Int64, str) >>> if num != parse(str) throw(FOO) end >>> num >>> catch ... end >>> >>> But I don't know if it would work properly on 32 bits CPUs. >>> >>> -- Pierre-Yves >>> >>> On Saturday, November 23, 2013 5:07:47 PM UTC+1, Stefan Karpinski wrote: >>>> >>>> This is now done except for 128-bit integers, where LLVM's overflow >>>> detection is broken on some platforms. Issue opened to track the 128-bit >>>> problems: https://github.com/JuliaLang/julia/issues/4905. >>>> >>>> >>>> On Thu, Nov 21, 2013 at 2:29 AM, Eric Davies <[email protected]> wrote: >>>> >>>>> Thanks, glad to see this being worked on :) >>>>> >>>>> >>>>> On Wednesday, 20 November 2013 18:15:17 UTC-6, Stefan Karpinski wrote: >>>>> >>>>>> I started some work on this: https://github.com/JuliaLang/j >>>>>> ulia/pull/4875. >>>>>> >>>>>> >>>>>> On Wed, Nov 20, 2013 at 6:33 PM, Stefan Karpinski < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Yes, this should raise an error on overflow: >>>>>>> >>>>>>> https://github.com/JuliaLang/julia/blob/704b852d54cb9b02f07e >>>>>>> a084b102dec8fb2dca2a/base/string.jl#L1472 >>>>>>> >>>>>>> Up-for-grabs issue created: https://github.com/JuliaLang/j >>>>>>> ulia/issues/4874. >>>>>>> >>>>>>> >>>>>>> On Wed, Nov 20, 2013 at 6:00 PM, Eric Davies <[email protected]>wrote: >>>>>>> >>>>>>>> julia> integer("9223372036854775807") >>>>>>>> 9223372036854775807 >>>>>>>> >>>>>>>> julia> integer("9223372036854775808") >>>>>>>> -9223372036854775808 >>>>>>>> >>>>>>>> I'm looking for a function that will error (or return some >>>>>>>> indication of validity) on large integers rather than failing. Does >>>>>>>> such a >>>>>>>> thing exist? It's my opinion that parseint should do this, even though >>>>>>>> it >>>>>>>> currently performs the same as above. >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>> >
