~ubuntu-branches/ubuntu/oneiric/bc/oneiric

« back to all changes in this revision

Viewing changes to lib/number.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 12:24:03 UTC
  • mfrom: (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20071205122403-rv1a7x90ktu1wl95
Tags: 1.06.94-3ubuntu1
* Merge with Debian; remaining changes:
  - Make bc/dc notice read and write errors on its input and output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
    along with this program; see the file COPYING.  If not, write to:
17
17
 
18
18
      The Free Software Foundation, Inc.
19
 
      59 Temple Place, Suite 330
20
 
      Boston, MA 02111-1307 USA.
 
19
      51 Franklin Street, Fifth Floor
 
20
      Boston, MA 02110-1301  USA
21
21
 
22
22
 
23
23
    You may contact the author by:
33
33
#include <config.h>
34
34
#include <number.h>
35
35
#include <assert.h>
 
36
#ifdef HAVE_STDLIB_H
36
37
#include <stdlib.h>
37
 
#include <ctype.h>/* Prototypes needed for external utility routines. */
 
38
#endif
 
39
#ifdef HAVE_STRING_H
 
40
#include <string.h>
 
41
#endif
 
42
#include <ctype.h>
 
43
 
 
44
/* Prototypes needed for external utility routines. */
38
45
 
39
46
#define bc_rt_warn rt_warn
40
47
#define bc_rt_error rt_error
1653
1660
/* Convert a numbers to a string.  Base 10 only.*/
1654
1661
 
1655
1662
char
1656
 
*num2str (num)
 
1663
*bc_num2str (num)
1657
1664
      bc_num num;
1658
1665
{
1659
1666
  char *str, *sptr;
1761
1768
    }
1762
1769
}
1763
1770
 
 
1771
/* Debugging routines */
 
1772
 
 
1773
#ifdef DEBUG
 
1774
 
1764
1775
/* pn prints the number NUM in base 10. */
1765
1776
 
1766
1777
static void
1795
1806
  checkferror_output(stdout);
1796
1807
}
1797
1808
 
 
1809
#endif
1798
1810
 
1799
1811
/* check ferror() status and if so die */
1800
1812
void