On 29 January 2013 19:06, Walter Bright <newshound2@digitalmars.com> wrote:
On 1/29/2013 4:31 AM, Don wrote:
Since it got lost in the old thread on this topic, I'll repost my versions of
floatToshort and shortToFloat, which are extremely fast (no unpredictable
branches, no lookup tables) and respect the current rounding mode:

I was waiting on incorporating your improvements until after std.halffloat was merged into Phobos. This is because the old ones were easier to understand, and I wanted them in the repository history.



I'm sure this was mentioned before, but what does halffloat have over std.numeric.CustomFloat?


Thanks
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';