fmtlib.c File Reference

#include "f2c.h"

Include dependency graph for fmtlib.c:

Go to the source code of this file.

Defines

#define MAXINTLENGTH   23
#define longint   long
#define ulongint   unsigned long

Functions

char * f__icvt (longint value, int *ndigit, int *sign, int base)


Define Documentation

#define longint   long

Definition at line 10 of file fmtlib.c.

#define MAXINTLENGTH   23

Definition at line 2 of file fmtlib.c.

Referenced by f__icvt().

#define ulongint   unsigned long

Definition at line 12 of file fmtlib.c.

Referenced by f__icvt(), qbit_bits(), and qbit_cshift().


Function Documentation

char* f__icvt ( longint  value,
int ndigit,
int sign,
int  base 
)

Definition at line 19 of file fmtlib.c.

References buf, i, MAXINTLENGTH, and ulongint.

Referenced by lwrt_I(), wrt_I(), and wrt_IM().

00021 {
00022         static char buf[MAXINTLENGTH+1];
00023         register int i;
00024         ulongint uvalue;
00025 
00026         if(value > 0) {
00027                 uvalue = value;
00028                 *sign = 0;
00029                 }
00030         else if (value < 0) {
00031                 uvalue = -value;
00032                 *sign = 1;
00033                 }
00034         else {
00035                 *sign = 0;
00036                 *ndigit = 1;
00037                 buf[MAXINTLENGTH-1] = '0';
00038                 return &buf[MAXINTLENGTH-1];
00039                 }
00040         i = MAXINTLENGTH;
00041         do {
00042                 buf[--i] = (char) ((uvalue%base) + '0');
00043                 uvalue /= base;
00044                 }
00045                 while(uvalue > 0);
00046         *ndigit = MAXINTLENGTH - i;
00047         return &buf[i];
00048         }

Here is the caller graph for this function:


Generated on Sun Mar 4 15:04:41 2007 for Scilab [trunk] by  doxygen 1.5.1