/[jscoverage]/trunk/js/jslibmath.h
ViewVC logotype

Diff of /trunk/js/jslibmath.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 506 by siliconforks, Tue Dec 9 03:37:47 2008 UTC revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC
# Line 65  Line 65 
65  #define js_copysign copysign  #define js_copysign copysign
66  #endif  #endif
67    
68    /* Consistency wrapper for platform deviations in fmod() */
69    static inline double
70    js_fmod(double d, double d2)
71    {
72    #ifdef XP_WIN
73        /*
74         * Workaround MS fmod bug where 42 % (1/0) => NaN, not 42.
75         * Workaround MS fmod bug where -0 % -N => 0, not -0.
76         */
77        if ((JSDOUBLE_IS_FINITE(d) && JSDOUBLE_IS_INFINITE(d2)) ||
78            (d == 0 && JSDOUBLE_IS_FINITE(d2))) {
79            return d;
80        }
81    #endif
82        return fmod(d, d2);
83    }
84    
85  #endif /* _LIBMATH_H */  #endif /* _LIBMATH_H */
86    

Legend:
Removed from v.506  
changed lines
  Added in v.507

  ViewVC Help
Powered by ViewVC 1.1.24