OK. The document could be made more clear and user friendly. When I saw the 
function `parse`, my feeling was...

(I shouldn't say that, or people will again ask me to improve the 
document...)



On Tuesday, August 4, 2015 at 2:52:16 AM UTC+2, Yichao Yu wrote:
>
> On Mon, Aug 3, 2015 at 8:17 PM, Sisyphuss <[email protected] 
> <javascript:>> wrote: 
> > In the online help document  "Arbitrary Precision Arithmetic" section 
> > (
> http://docs.julialang.org/en/latest/manual/integers-and-floating-point-numbers/),
>  
>
> > 
> > it uses `parse` to construct `BigInt`, and claims that promotion are not 
> > automatic. 
>
> All what it says is true AFAICT. 
>
> > parse() can be use to construct them from AbstractStrings 
>
> `parse(...)` is nothing different from what you get from typing a big 
> number in the source code both should work. I don't know why it 
> doesn't mention you can just type a big number so that could probably 
> be added. 
>
> > However, type promotion between the primitive types above and 
> BigInt/BigFloat is not automatic and must be explicitly stated. 
>
> The promotion is not automatic and not likely to ever be. In the 
> example you have below the result is BigInt because the first operand 
> is a BigInt. 
>
> > 
> > But in my experience (v0.3.11 and v0.4-dev), it is not the case. 
> > 
> >> 12345678901234567890123456789000000000000000 + 1 
> > 
> > 12345678901234567890123456789000000000000001 
> > 
> >>typeof(ans) 
> > 
> > Base.GMP.BigInt 
> > 
> > 
> > 
>

Reply via email to