A C function which accepts a large integer type?

Is there anyway in C I can write a function which accepts a very large
integer? That is, say in LLVM I'm using a 256bit integer, is it possible
to write a C function which accepts that value?

I understand it wouldn't be standard C, or may not even be pretty, but
that doesn't matter.

edA-qa mort-ora-y <eda-qa@disemia.com> writes:

Is there anyway in C I can write a function which accepts a very large
integer? That is, say in LLVM I'm using a 256bit integer, is it possible
to write a C function which accepts that value?

I understand it wouldn't be standard C, or may not even be pretty, but
that doesn't matter.

What's wrong with passing the address of the integer?

Yes, that idea came to me also shortly after pressing "Send". :wink:

I assume the data is simply ordered like a native integer. So on
little-endian it is lowest byte first.

Hi edA-qa mort-ora-y,

Actually I would also like to know that case (as I support odd sizes).
If this is too complicated though I would just extend them to the next
power of 2 before calling the function.

IIRC, they are extended to the nearest multiple of 8 bits by adding bits with
an unspecified value, then the extended integer is stored.

Ciao, Duncan.