Re: A89: TIGCCLIB 2.0 released!


[Prev][Next][Index][Thread]

Re: A89: TIGCCLIB 2.0 released!




Hi!

> I must admit I'm quite new to TIGCClib. In fact, what I'm looking for is
> a method to manipulate very big integers, like in TI-Basic. In timath.h,
> I found some functions to use AMS floats, but nothing for AMS integers. 

So far, I think that the only method to use TIOS (for big integers) is
to push two big integers manually to the estack, then to push appropriate
operation tag on the estack and call NG_rationalESI. After this, the
result is on estack, so it may be picked from the estack. Simple but
slow method is using push_parse_text: this will surely work:

push_parse_text("1000000000000000000000");
push_parse_text("2000000000000000000000");
push_quantum(ADD_TAG);
NG_rationalESI();

After this, the result is on estack.

> What I would like to do would be to have big integers passed as
> parameters to my program. I found the function GetIntArg(), however it
> seems that it can only return a "C" integer. 

Yes. But, it is not hard to pick "big" integers from the estack. If
argptr points to POSINT_TAG, then the byte below is the number of bytes
occupied by the big integer, and appropriate number of bytes below
contain the integer itself.

> Is there a data type somewhere, similar to BN, that allow to 
> manipulate AMS integers ?

So far, no. But, I can try to made a such structure.

Zeljko Juric