/[guile]/guile/guile-core/libguile/numbers.c
ViewVC logotype

Diff of /guile/guile-core/libguile/numbers.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.196 by kryde, Thu Jul 24 01:03:40 2003 UTC revision 1.197 by mvo, Sun Jul 27 13:34:32 2003 UTC
# Line 128  static mpz_t z_negative_one; Line 128  static mpz_t z_negative_one;
128    
129  static const char s_bignum[] = "bignum";  static const char s_bignum[] = "bignum";
130    
131  SCM_C_INLINE SCM  SCM_C_INLINE_KEYWORD SCM
132  scm_i_mkbig ()  scm_i_mkbig ()
133  {  {
134    /* Return a newly created bignum. */    /* Return a newly created bignum. */
# Line 137  scm_i_mkbig () Line 137  scm_i_mkbig ()
137    return z;    return z;
138  }  }
139    
140  SCM_C_INLINE static SCM  SCM_C_INLINE_KEYWORD static SCM
141  scm_i_clonebig (SCM src_big, int same_sign_p)  scm_i_clonebig (SCM src_big, int same_sign_p)
142  {  {
143    /* Copy src_big's value, negate it if same_sign_p is false, and return. */    /* Copy src_big's value, negate it if same_sign_p is false, and return. */
# Line 148  scm_i_clonebig (SCM src_big, int same_si Line 148  scm_i_clonebig (SCM src_big, int same_si
148    return z;    return z;
149  }  }
150    
151  SCM_C_INLINE int  SCM_C_INLINE_KEYWORD int
152  scm_i_bigcmp (SCM x, SCM y)  scm_i_bigcmp (SCM x, SCM y)
153  {  {
154    /* Return neg if x < y, pos if x > y, and 0 if x == y */    /* Return neg if x < y, pos if x > y, and 0 if x == y */
# Line 158  scm_i_bigcmp (SCM x, SCM y) Line 158  scm_i_bigcmp (SCM x, SCM y)
158    return result;    return result;
159  }  }
160    
161  SCM_C_INLINE SCM  SCM_C_INLINE_KEYWORD SCM
162  scm_i_dbl2big (double d)  scm_i_dbl2big (double d)
163  {  {
164    /* results are only defined if d is an integer */    /* results are only defined if d is an integer */
# Line 167  scm_i_dbl2big (double d) Line 167  scm_i_dbl2big (double d)
167    return z;    return z;
168  }  }
169    
170  SCM_C_INLINE double  SCM_C_INLINE_KEYWORD double
171  scm_i_big2dbl (SCM b)  scm_i_big2dbl (SCM b)
172  {  {
173    double result = mpz_get_d (SCM_I_BIG_MPZ (b));    double result = mpz_get_d (SCM_I_BIG_MPZ (b));
# Line 175  scm_i_big2dbl (SCM b) Line 175  scm_i_big2dbl (SCM b)
175    return result;    return result;
176  }  }
177    
178  SCM_C_INLINE SCM  SCM_C_INLINE_KEYWORD SCM
179  scm_i_normbig (SCM b)  scm_i_normbig (SCM b)
180  {  {
181    /* convert a big back to a fixnum if it'll fit */    /* convert a big back to a fixnum if it'll fit */

Legend:
Removed from v.1.196  
changed lines
  Added in v.1.197

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26