Skip to content

Commit

Permalink
Tweak auxilary functions to use emin
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikaitis committed May 29, 2024
1 parent cbbb158 commit a055c3f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/cpfloat_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,40 +73,40 @@ void fpopts_teardown(void) {
/* Return values of interest */
static inline
double minsubnormal(optstruct *fpopts) {
return ldexp(1., 2 - fpopts->emax - fpopts->precision);
return ldexp(1., fpopts->emin - fpopts->precision + 1);
}

static inline
double maxsubnormal(optstruct *fpopts) {
return ldexp(1., 1 - fpopts->emax) *
return ldexp(1., fpopts->emin) *
(1 - ldexp(1., 1 - fpopts->precision));
}

static inline
uint64_t intmaxsubnormal_double(optstruct *fpopts) {
return INTOFd(ldexp(1., 1 - fpopts->emax) *
return INTOFd(ldexp(1., fpopts->emin) *
(1 - ldexp(1., 1 - fpopts->precision)));
}

static inline
uint32_t intmaxsubnormal_float(optstruct *fpopts) {
return INTOFf(ldexp(1., 1 - fpopts->emax) *
return INTOFf(ldexp(1., fpopts->emin) *
(1 - ldexp(1., 1 - fpopts->precision)));
}

static inline
double minnormal(optstruct *fpopts) {
return ldexp(1., 1-fpopts->emax);
return ldexp(1., fpopts->emin);
}

static inline
uint64_t intminnormal_double(optstruct *fpopts) {
return INTOFd(ldexp(1., 1-fpopts->emax));
return INTOFd(ldexp(1., fpopts->emin));
}

static inline
uint32_t intminnormal_float(optstruct *fpopts) {
return INTOFf(ldexp(1., 1-fpopts->emax));
return INTOFf(ldexp(1., fpopts->emin));
}

static inline
Expand Down

0 comments on commit a055c3f

Please sign in to comment.