Diff for /gforth/engine/dblsub.c between versions 1.3 and 1.5

version 1.3, 2003/03/09 15:17:02 version 1.5, 2006/10/22 16:54:00
Line 1 Line 1
 /* some routines for double-cell arithmetic  /* some routines for double-cell arithmetic
    only used if BUGGY_LONG_LONG     only used if BUGGY_LONG_LONG
   
    Copyright (C) 1996,2000 Free Software Foundation, Inc.     Copyright (C) 1996,2000,2003 Free Software Foundation, Inc.
  * Copyright (C) 1995  Dirk Uwe Zoller   * Copyright (C) 1995  Dirk Uwe Zoller
  *   *
  * This library is free software; you can redistribute it and/or   * This library is free software; you can redistribute it and/or
Line 81  UDCell umdiv (UDCell u, UCell v) Line 81  UDCell umdiv (UDCell u, UCell v)
   UCell q = 0, h = u.hi, l = u.lo;    UCell q = 0, h = u.hi, l = u.lo;
   UDCell res;    UDCell res;
   
     if (v==0)
       throw(BALL_DIVZERO);
     if (h>=v)
       throw(BALL_RESULTRANGE);
   for (;;)    for (;;)
     {      {
       if (c || h >= v)        if (c || h >= v)
Line 112  DCell smdiv (DCell num, Cell denom) /* s Line 116  DCell smdiv (DCell num, Cell denom) /* s
   if (denomsign < 0)    if (denomsign < 0)
     denom = -denom;      denom = -denom;
   res = UD2D(umdiv (D2UD(num), denom));    res = UD2D(umdiv (D2UD(num), denom));
   if ((numsign^denomsign)<0)    if (res.lo >= (UCell)CELL_MIN)
       throw(BALL_RESULTRANGE);
     if ((numsign^denomsign)<0) {
       if (res.lo == CELL_MIN)
         throw(BALL_RESULTRANGE);
     res.lo = -res.lo;      res.lo = -res.lo;
     }
   if (numsign<0)    if (numsign<0)
     res.hi = -res.hi;      res.hi = -res.hi;
   return res;    return res;
Line 132  DCell fmdiv (DCell num, Cell denom) /* f Line 141  DCell fmdiv (DCell num, Cell denom) /* f
   if (num.hi < 0)    if (num.hi < 0)
     num.hi += denom;      num.hi += denom;
   res = UD2D(umdiv(D2UD(num),denom));    res = UD2D(umdiv(D2UD(num),denom));
     if (res.lo >= (UCell)CELL_MIN)
       throw(BALL_RESULTRANGE);
   if (denomsign<0)    if (denomsign<0)
     res.hi = -res.hi;      res.hi = -res.hi;
   return res;    return res;

Removed from v.1.3  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>