Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: src/platform-win32.cc

Issue 14362023: Replace math.h with cmath (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-solaris.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // Note: here we rely on dependent reads being ordered. This is true 181 // Note: here we rely on dependent reads being ordered. This is true
182 // on all architectures we currently support. 182 // on all architectures we currently support.
183 return (*modulo_function)(x, y); 183 return (*modulo_function)(x, y);
184 } 184 }
185 #else // Win32 185 #else // Win32
186 186
187 double modulo(double x, double y) { 187 double modulo(double x, double y) {
188 // Workaround MS fmod bugs. ECMA-262 says: 188 // Workaround MS fmod bugs. ECMA-262 says:
189 // dividend is finite and divisor is an infinity => result equals dividend 189 // dividend is finite and divisor is an infinity => result equals dividend
190 // dividend is a zero and divisor is nonzero finite => result equals dividend 190 // dividend is a zero and divisor is nonzero finite => result equals dividend
191 if (!(isfinite(x) && (!isfinite(y) && !isnan(y))) && 191 if (!(std::isfinite(x) && (!std::isfinite(y) && !std::isnan(y))) &&
192 !(x == 0 && (y != 0 && isfinite(y)))) { 192 !(x == 0 && (y != 0 && std::isfinite(y)))) {
193 x = fmod(x, y); 193 x = fmod(x, y);
194 } 194 }
195 return x; 195 return x;
196 } 196 }
197 197
198 #endif // _WIN64 198 #endif // _WIN64
199 199
200 200
201 #define UNARY_MATH_FUNCTION(name, generator) \ 201 #define UNARY_MATH_FUNCTION(name, generator) \
202 static UnaryMathFunction fast_##name##_function = NULL; \ 202 static UnaryMathFunction fast_##name##_function = NULL; \
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 limit_mutex = CreateMutex(); 1986 limit_mutex = CreateMutex();
1987 } 1987 }
1988 1988
1989 1989
1990 void OS::TearDown() { 1990 void OS::TearDown() {
1991 delete limit_mutex; 1991 delete limit_mutex;
1992 } 1992 }
1993 1993
1994 1994
1995 } } // namespace v8::internal 1995 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-solaris.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698