Branch: Tag:

1999-10-19

1999-10-19 22:21:32 by Fredrik Noring <noring@nocrew.org>

Bignum additions: a) small number function call emulation using Gmp, b) intp, c) sprintf %O (describe_svalue), d) sqrt and e) casting from float to integer.

Rev: src/bignum.c:1.4
Rev: src/bignum.h:1.5
Rev: src/builtin_functions.c:1.188
Rev: src/modules/_math/math.c:1.23
Rev: src/opcodes.c:1.44
Rev: src/svalue.c:1.46

22:   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h" + #include "bignum.h"    - RCSID("$Id: opcodes.c,v 1.43 1999/08/21 23:21:07 noring Exp $"); + RCSID("$Id: opcodes.c,v 1.44 1999/10/19 22:21:30 noring Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {
37:       switch(what->type)    { + #ifdef AUTO_BIGNUM +  case T_INT: +  convert_svalue_to_bignum(what); +  index_no_free(to, what, ind); +  break; + #endif /* AUTO_BIGNUM */ +     case T_ARRAY:    simple_array_index_no_free(to,what->u.array,ind);    break;
186:    {    case T_FLOAT:    i=(int)(sp[-1].u.float_number); + #ifdef AUTO_BIGNUM +  if((i < 0 ? -i : i) < fabs(floor(sp[-1].u.float_number))) +  { +  /* Note: This includes the case when i = 0x80000000, i.e. +  the absolute value is not computable. */ +  convert_stack_top_to_bignum(); +  return; +  } + #endif /* AUTO_BIGNUM */    break;       case T_STRING: