Re: problem with integer in extension (still)

From: Erick Gallesio <eg_at_kaolin.unice.fr>
Date: Fri, 10 Nov 1995 20:33:45 +0000

Sarah Officer writes:

> If I want to extract a long from an SCM object in C,
> what is the best routine to use rather than STk_integer_value? What
> does STk do internally which makes INTEGERP succeed on a number that
> gets this large? Is there a quick fix?
>

You must use the function
        /* Returns LONG_MIN if not an integer */
        long STk_integer_value_no_overflow(SCM x);

This function returns LONG_MIN if x is not an integer nor a bignum.
As its name says it doesn't test overflow at all that means that it returns
always a value, even if x is out of the range of valid longs.
Hope it helps

                -- Erick
Received on Fri Nov 10 1995 - 20:33:46 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST