Integer* Integer::from(STATE, unsigned int num) { #ifndef IS_X8664 if(num > FIXNUM_MAX) { return Bignum::from(state, (unsigned long)num); } #endif return (Fixnum*)APPLY_FIXNUM_TAG((native_int)num); }
Integer* Integer::from(STATE, int num) { #ifndef IS_X8664 if(num > FIXNUM_MAX || num < FIXNUM_MIN) { /* Number is too big for Fixnum. Use Bignum. */ return Bignum::from(state, (native_int)num); } #endif return (Fixnum*)APPLY_FIXNUM_TAG(num); }
/* WARNING. Do not use this version if +num+ has the chance of being * greater than FIXNUM_MAX or less than FIXNUM_MIN. */ static Fixnum* from(native_int num) { return (Fixnum*)APPLY_FIXNUM_TAG(num); }
Integer* Integer::from(STATE, unsigned long num) { if(num > FIXNUM_MAX) { return Bignum::from(state, num); } return (Fixnum*)APPLY_FIXNUM_TAG((native_int)num); }
Integer* Integer::from(STATE, long long num) { if(num > FIXNUM_MAX || num < FIXNUM_MIN) { return Bignum::from(state, num); } return (Fixnum*)APPLY_FIXNUM_TAG((native_int)num); }