Re: [Rd] large integer values

2014-05-14 Thread Adrian Dușa
On Wed, May 14, 2014 at 6:24 PM, Martyn Plummer wrote: > [...] > > Your numbers are being coerced to int when you print them. Try the > format ", %lld" instead. Oh my goodness, this was a printing issue...! (feeling embarrassed, but learned something new) Problem solved, thanks very much all,

Re: [Rd] large integer values

2014-05-14 Thread Martyn Plummer
On Wed, 2014-05-14 at 18:17 +0300, Adrian Dușa wrote: > On Wed, May 14, 2014 at 5:35 PM, Simon Urbanek > wrote: > > > [...] > > > > How do you print them? It seems like you're printing 32-bit value instead > > ... (powers of 2 are simply shifts of 1). > > > > > I am simply using Rprintf(): > >

Re: [Rd] large integer values

2014-05-14 Thread Adrian Dușa
On Wed, May 14, 2014 at 5:35 PM, Simon Urbanek wrote: > [...] > > How do you print them? It seems like you're printing 32-bit value instead > ... (powers of 2 are simply shifts of 1). > > I am simply using Rprintf(): long long int power[lgth]; power[lgth - 1] = 1; Rprintf("power: %d",

Re: [Rd] large integer values

2014-05-14 Thread Simon Urbanek
On May 14, 2014, at 8:41 AM, Adrian Dușa wrote: > Dear Prof. Ripley, > > Once again, thank you for your replies. > I must confess not being a genuine C programmer, having learned how to use > C only in connection to R (and the macros provided are almost a separate > language to learn). > > I'll

Re: [Rd] large integer values

2014-05-14 Thread Adrian Dușa
Dear Prof. Ripley, Once again, thank you for your replies. I must confess not being a genuine C programmer, having learned how to use C only in connection to R (and the macros provided are almost a separate language to learn). I'll try to read more about the types you've indicated, and will keep

Re: [Rd] large integer values

2014-05-14 Thread Prof Brian Ripley
On 14/05/2014 10:37, Adrian Dușa wrote: Dear devels, I need to create a (short) vector in C, which contains potentially very large numbers, exponentially to the powers of 2. This isn't an R question, except in so far that R mandates the usual convention of C being 32-bit. However 1) You s