Changeset 544

Show
Ignore:
Timestamp:
01/18/08 02:31:25 (11 months ago)
Author:
Don Clugston
Message:

Bugfix for feqrel() for systems with 64-bit reals.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • candidate/phobos/std/math.d

    r543 r544  
    19191919        const int EXPONENTPOS = 3; 
    19201920    else const int EXPONENTPOS = 0; 
    1921     int bitsdiff = ( ((pa[EXPONENTPOS]&0x7FF0) + (pb[EXPONENTPOS]&0x7FF0)-0x10)>>5)  
    1922                  - (pd[EXPONENTPOS]&0x7FF0>>4)
     1921    int bitsdiff = (( ((pa[EXPONENTPOS]&0x7FF0) + (pb[EXPONENTPOS]&0x7FF0)-0x10)>>1)  
     1922                 - (pd[EXPONENTPOS]&0x7FF0))>>4
    19231923 } 
    19241924    if (pd[EXPONENTPOS] == 0) 
     
    19391939    return (bitsdiff == 0) ? (pa[EXPONENTPOS] == pb[EXPONENTPOS]) : 0; 
    19401940 } else { 
    1941     if (bitsdiff == 0 && (pa[EXPONENTPOS] ^ pb[EXPONENTPOS])&0x7FF0) return 1; 
     1941    if (bitsdiff == 0 && !((pa[EXPONENTPOS] ^ pb[EXPONENTPOS])&0x7FF0)) return 1; 
    19421942    else return 0; 
    19431943 }