Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
strtoIdd.c File Reference
#include "gdtoaimp.h"
Include dependency graph for strtoIdd.c:

Go to the source code of this file.

Functions

int strtoIdd (CONST char *s, char **sp, double *f0, double *f1)
 

Function Documentation

◆ strtoIdd()

int strtoIdd ( CONST char *  s,
char **  sp,
double *  f0,
double *  f1 
)

Definition at line 40 of file strtoIdd.c.

42 {
43 #ifdef Sudden_Underflow
44  static FPI fpi = {106, 1 - 1023, 2046 - 1023 - 106 + 1, 1, 1};
45 #else
46  static FPI fpi = {106, 1 - 1023 - 53 + 1, 2046 - 1023 - 106 + 1, 1, 0};
47 #endif
48  Long exp[2];
49  Bigint* B[2];
50  int k, rv[2];
51 
52  B[0] = Balloc(2);
53  B[0]->wds = 4;
54  k = strtoIg(s, sp, &fpi, exp, B, rv);
55  ULtodd((ULong*)f0, B[0]->x, exp[0], rv[0]);
56  Bfree(B[0]);
57  if(B[1])
58  {
59  ULtodd((ULong*)f1, B[1]->x, exp[1], rv[1]);
60  Bfree(B[1]);
61  }
62  else
63  {
64  ((ULong*)f1)[0] = ((ULong*)f0)[0];
65  ((ULong*)f1)[1] = ((ULong*)f0)[1];
66  ((ULong*)f1)[2] = ((ULong*)f0)[2];
67  ((ULong*)f1)[3] = ((ULong*)f0)[3];
68  }
69  return k;
70 }
int wds
Definition: gdtoaimp.h:487
void ULtodd(ULong *L, ULong *bits, Long exp, int k)
Definition: strtordd.c:41
unsigned Long ULong
Definition: gdtoa.h:41
void Bfree(Bigint *v)
Definition: misc.c:92
int strtoIg(CONST char *s00, char **se, FPI *fpi, Long *exp, Bigint **B, int *rvp)
Definition: strtoIg.c:43
Definition: gdtoa.h:86
Bigint * Balloc(int k)
Definition: misc.c:47
#define Long
Definition: gdtoa.h:38

References Balloc(), Bfree(), Long, strtoIg(), ULtodd(), and Bigint::wds.