[Issue 3520] std.numeric.CustomFloat horribly broken
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Mon Nov 16 20:20:17 PST 2009
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=3520
--- Comment #2 from David Simcha <dsimcha at yahoo.com> 2009-11-16 20:20:16 PST ---
Oh yea, while we're on the subject of overflow in CustomFloat and I'm reading
the code, is this right?
// denormalized source value
static if (flags & Flags.allowDenorm)
{
    exponent = 0;
    fraction = cast(typeof(fraction_max)) value.fraction;
}
Or should it be (from the normal value branch):
static if (fractionBits >= value.fractionBits)
{
    fraction = cast(typeof(fraction_max))
    (value.fraction << (fractionBits - value.fractionBits));
}
else
{
    fraction = cast(typeof(fraction_max))
    (value.fraction >> (value.fractionBits - fractionBits));
}
-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
    
    
More information about the Digitalmars-d-bugs
mailing list