HomeAleph Objects Inc
Diffusion numpy c36652fa6338

BUG: Fix rounding of denormals in double and float to half casts

Authored by Sebastian Berg <sebastian@sipsolutions.net> on Jan 12 2019, 7:17 AM.

Description

BUG: Fix rounding of denormals in double and float to half casts

Previously the significand was shifted right to align denormals of
different magnitude. This loses some bits that can make a difference
for rounding. This is fixed:

  1. For floats, by inspecting the original last bits when this may make a difference (should happen rarely)
  2. For doubles by shifting the bits left to align the denromals and thus not lose the lowest orginal bits.

Details

Event Timeline

Sebastian Berg <sebastian@sipsolutions.net> committed rNUc36652fa6338: BUG: Fix rounding of denormals in double and float to half casts (authored by Sebastian Berg <sebastian@sipsolutions.net>).Jan 12 2019, 7:22 AM