Changeset f08da1c in mainline


Ignore:
Timestamp:
2019-02-08T12:55:28Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
d3c129d
Parents:
d64303b
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-01-26 09:21:29)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-02-08 12:55:28)
Message:

Ensures that the exponent is smallest possible value if 0.0

The old implementation used 1 - BIAS to display the number
0.0. This is not correct since this would indicate that
the hidden bit is available. Significant part 0 and
smallest possible value for the exponent indicates
0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ieee_double.c

    rd64303b rf08da1c  
    9292                if (ret.is_denormal) {
    9393                        ret.pos_val.significand = raw_significand;
    94                         ret.pos_val.exponent = 1 - exponent_bias;
     94                        if (raw_significand == 0) {
     95                                ret.pos_val.exponent = -exponent_bias;
     96                        } else {
     97                                ret.pos_val.exponent = 1 - exponent_bias;
     98                        }
     99
    95100                        ret.is_accuracy_step = false;
    96101                } else {
Note: See TracChangeset for help on using the changeset viewer.