Bug 5293 – std.math: Error: shift by -48 is outside the range 0..32

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-11-30T22:00:00Z
Last change time
2010-12-04T21:49:38Z
Assigned to
nobody
Creator
ibuclaw

Comments

Comment #0 by ibuclaw — 2010-11-30T22:00:59Z
On about line 1328 inside frexp is this line: exp = (ex - F.EXPBIAS)>>> 4 - real.mant_dig + 1; Which produces an error when compiled. Is a blocker for building an ARM cross-compiler. Regards
Comment #1 by ibuclaw — 2010-11-30T22:08:20Z
Actually, now I've woken up a bit, I *think* what it should be is: @@ -1345,7 +1345,7 @@ // denormal value *= F.RECIP_EPSILON; ex = vu[F.EXPPOS_SHORT] & F.EXPMASK; - exp = (ex - F.EXPBIAS)>>> 4 - real.mant_dig + 1; + exp = ((ex - F.EXPBIAS)>>> 4) - real.mant_dig + 1; vu[F.EXPPOS_SHORT] = cast(ushort)((0x8000 & vu[F.EXPPOS_SHORT]) | 0x3FE0); } Can someone confirm? Regards
Comment #2 by clugdbug — 2010-12-02T21:37:55Z
I have posted a fix in svn 2206. Please confirm.
Comment #3 by ibuclaw — 2010-12-04T15:18:46Z
Looks good, makes more sense to use >>, thanks!