Doxygen Source Code Documentation
fmtlib.c File Reference
#include "f2c.h"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
|
|
Definition at line 7 of file fmtlib.c. Referenced by f__icvt(). |
|
|
Definition at line 2 of file fmtlib.c. Referenced by f__icvt(). |
|
|
Definition at line 9 of file fmtlib.c. Referenced by f__icvt(), qbit_bits(), and qbit_cshift(). |
Function Documentation
|
||||||||||||||||||||
|
Definition at line 16 of file fmtlib.c. References base, i, longint, MAXINTLENGTH, and ulongint. Referenced by lwrt_I(), wrt_I(), and wrt_IM().
00018 {
00019 static char buf[MAXINTLENGTH+1];
00020 register int i;
00021 ulongint uvalue;
00022
00023 if(value > 0) {
00024 uvalue = value;
00025 *sign = 0;
00026 }
00027 else if (value < 0) {
00028 uvalue = -value;
00029 *sign = 1;
00030 }
00031 else {
00032 *sign = 0;
00033 *ndigit = 1;
00034 buf[MAXINTLENGTH-1] = '0';
00035 return &buf[MAXINTLENGTH-1];
00036 }
00037 i = MAXINTLENGTH;
00038 do {
00039 buf[--i] = (uvalue%base) + '0';
00040 uvalue /= base;
00041 }
00042 while(uvalue > 0);
00043 *ndigit = MAXINTLENGTH - i;
00044 return &buf[i];
00045 }
|