[Rd] unsigned long long integers

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Mon 24 Apr 2006 - 09:29:35 GMT


Hi.

R-exts, section 1.7, discusses the passing of long long integers between R and C.
I want to use unsigned long long integers, but I only need them inside a C function.

I have a function that maps the nonnegative integers to the positive integers.
The function is defined by a delicate recursive algorithm that is exact for integer arithmetic, but wildly incorrect for doubles.

The function increases rapidly with its argument, and ordinary integers are not enough to illustrate my point (in a paper I am writing).

The C function is as follows:

void numbparts_longint(int *n, double *p){/* p(1)...p(n) calculated */

         int i,s,f,r;
         unsigned long long int *ip;
         unsigned long long int pp[*n];

/* COMPLICATED RECURSIVE ALGORITHM IN WHICH PP IS FILLED SNIPPED */

         for(i=0 ; i < *n ; i++){
                 p[i] = (double) pp[i];
         }

}

This compiles fine with "gcc -Wall" (and illustrates my point!) but R CMD check reports

   partitions.c:180: warning: ISO C90 does not support 'long long'    partitions.c:181: warning: ISO C90 does not support 'long long'

I really want long long integers here. What are my options? [the same happens with signed long long integers]

--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon Apr 24 19:35:07 2006

This archive was generated by hypermail 2.1.8 : Mon 24 Apr 2006 - 10:17:55 GMT