mirror of
https://gitlab.com/80486DX2-66/gists
synced 2024-11-09 21:32:02 +05:30
floatscan-experiment.c: rename floatscan
to interface_floatscan
This commit is contained in:
parent
f9d6c96a30
commit
7fae55a31e
@ -49,7 +49,7 @@ const char* fgetc_ptr = NULL;
|
|||||||
|
|
||||||
static int __shgetc(void);
|
static int __shgetc(void);
|
||||||
static int __shunget(void);
|
static int __shunget(void);
|
||||||
static long double floatscan(const char* s, int prec);
|
static long double interface_floatscan(const char* s, int prec);
|
||||||
|
|
||||||
#define shgetc(f) __shgetc()
|
#define shgetc(f) __shgetc()
|
||||||
#define shlim(...)
|
#define shlim(...)
|
||||||
@ -576,7 +576,7 @@ static int __shunget(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static long double floatscan(const char* s, int prec) {
|
static long double interface_floatscan(const char* s, int prec) {
|
||||||
fgetc_ptr = s;
|
fgetc_ptr = s;
|
||||||
return __floatscan(NULL, prec, 1);
|
return __floatscan(NULL, prec, 1);
|
||||||
}
|
}
|
||||||
@ -588,7 +588,7 @@ int main(int argc, char** argv) {
|
|||||||
const int prec = LD_B1B_DIG;
|
const int prec = LD_B1B_DIG;
|
||||||
|
|
||||||
printf("Selected precision index = %d\n", prec);
|
printf("Selected precision index = %d\n", prec);
|
||||||
long double result = floatscan(value, LONG_DOUBLE_TYPE);
|
long double result = interface_floatscan(value, LONG_DOUBLE_TYPE);
|
||||||
printf("Input : %s\n", value);
|
printf("Input : %s\n", value);
|
||||||
printf("Decimal floating-point format: %Lf\n", result);
|
printf("Decimal floating-point format: %Lf\n", result);
|
||||||
printf("Double floating-point format : %Lg\n", result);
|
printf("Double floating-point format : %Lg\n", result);
|
||||||
|
Loading…
Reference in New Issue
Block a user