Rinzii / ccmath

A C++17 Compile Time <cmath> Library
Other
40 stars 10 forks source link

[Feature] Implementation of ldexp #35

Closed GDBobby closed 3 months ago

GDBobby commented 4 months ago

Return of ldexp

GDBobby commented 4 months ago

When the result of ldexp is casted to a float it's still correct, but I'm assuming that's unacceptable

ccm::support::get_exponent_of_floating_point is returning an incorrect value when the parameter is a double with value -0.0 not sure why yet

Edit: Solution found - I'm assuming the issue is that the -0.0 exponent is converted to -1023 on get_exponent, while the minimum exponent is -1022. Now, in ldexp if the exponent is less than the minimum for that type, the num parameter is returned

GDBobby commented 4 months ago

exp is an int

Rinzii commented 4 months ago

exp is an int

My bad must of been shown an older bit of code when I was doing my review.

Rinzii commented 4 months ago

Also remember to press the "Resolve conversation" button once a change request has been done! This helps me know if everything has been resolved. ^^

GDBobby commented 3 months ago

My bad, didn't see the merge conflicts. Having a multitude of unrelated issues to that now lol