1 /*-------------------------------------------------------------------------
2 _divschar.c :- routine for signed char (8 bit) division. just calls
3 routine for unsigned division after sign adjustment
5 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
6 Adopted for char (8-bit) and pic16 port by
7 - Vangelis Rokas, vrokas@otenet.gr (2004)
9 This library is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Library General Public License as published by the
11 Free Software Foundation; either version 2, or (at your option) any
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 In other words, you are welcome to use, share and improve this program.
24 You are forbidden to forbid anyone else to use, share and improve
25 what you give them. Help stamp out software-hoarding!
26 -------------------------------------------------------------------------*/
30 unsigned char _divuchar (unsigned char a, unsigned char b);
32 char _divschar (char a, char b) _IL_REENTRANT
37 if(a<0)ta = -a; else ta = a;
38 if(b<0)tb = -b; else tb = b;
40 r = _divuchar(ta, tb);
43 if ( (a < 0) ^ (b < 0))