Skip to content

Commit

Permalink
Addressed comments on PR #4
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikaitis committed Apr 30, 2024
1 parent c63547f commit 1cb50e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/cpfloat_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ typedef struct {
* @brief Maximum exponent of target format.
*
* @details The maximum values allowed are 127 and 1023 if the storage format
* is `float` or `double`, respectively. Larger values are reduced to the
* maximum allowed value without warning. This field is ignored unless
* `explim` is set to `CPFLOAT_EXPRANGE_TARG`.
* is `float` or `double`, respectively. If a larger value is chosen, it is
* changed to the maximum allowed value without warning. This field is ignored
* unless `explim` is set to `CPFLOAT_EXPRANGE_TARG`.
*
* The validation functions cpfloatf_validate_optstruct() and
* cpfloat_validate_optstruct() return an error code if the required maximum
Expand All @@ -206,9 +206,9 @@ typedef struct {
* @brief Minimum exponent of target format.
*
* @details The minimum values allowed are -126 and -1022 if the storage format
* is `float` or `double`, respectively. Smaller values are increase to the
* minimum allowed value without warning. This field is ignored unless
* `explim` is set to `CPFLOAT_EXPRANGE_TARG`.
* is `float` or `double`, respectively. If a smaller value is chosen, it is
* changed to the minimum allowed value without warning. This field is ignored
* unless `explim` is set to `CPFLOAT_EXPRANGE_TARG`.
*
* The validation functions cpfloatf_validate_optstruct() and
* cpfloat_validate_optstruct() return an error code if the required minimum
Expand Down
8 changes: 4 additions & 4 deletions src/cpfloat_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ optstruct *init_optstruct() {
fpopts->bitseed = NULL;
fpopts->randseedf = NULL;
fpopts->randseed = NULL;
fpopts->emin = -99999;
fpopts->emin = 0;
return fpopts;
}

Expand Down Expand Up @@ -283,7 +283,7 @@ static inline int VALIDATE_INPUT(const optstruct *fpopts) {
/* Return -6 if emin is invalid (either nonnegative or too small). */
if (fpopts->emin < DEFEMIN || fpopts->emin >= 0)
return -6;

/* Return 0 or warning value. */
return retval;
}
Expand All @@ -310,8 +310,8 @@ static inline FPPARAMS COMPUTE_GLOBAL_PARAMS(const optstruct *fpopts,

/* Derived floating point parameters. */
int emin = fpopts->emin;
/* If emin is not set by user, set it to the default 1-emax. */
if (emin == -99999)
/* If emin is not set by the user, set it to the default 1-emax. */
if (emin == 0)
emin = 1-emax;
if (emin < DEFEMIN) {
emax = DEFEMIN;
Expand Down

0 comments on commit 1cb50e0

Please sign in to comment.