| OLD | NEW |
| 1 dart_library.library('dart/math', null, /* Imports */[ | 1 dart_library.library('dart/math', null, /* Imports */[ |
| 2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
| 3 'dart/core' | 3 'dart/core' |
| 4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
| 5 'dart/_js_helper' | 5 'dart/_js_helper' |
| 6 ], function(exports, dart, core, _js_helper) { | 6 ], function(exports, dart, core, _js_helper) { |
| 7 'use strict'; | 7 'use strict'; |
| 8 let dartx = dart.dartx; | 8 let dartx = dart.dartx; |
| 9 class _JenkinsSmiHash extends core.Object { | 9 class _JenkinsSmiHash extends core.Object { |
| 10 static combine(hash, value) { | 10 static combine(hash, value) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 let E = 2.718281828459045; | 258 let E = 2.718281828459045; |
| 259 let LN10 = 2.302585092994046; | 259 let LN10 = 2.302585092994046; |
| 260 let LN2 = 0.6931471805599453; | 260 let LN2 = 0.6931471805599453; |
| 261 let LOG2E = 1.4426950408889634; | 261 let LOG2E = 1.4426950408889634; |
| 262 let LOG10E = 0.4342944819032518; | 262 let LOG10E = 0.4342944819032518; |
| 263 let PI = 3.141592653589793; | 263 let PI = 3.141592653589793; |
| 264 let SQRT1_2 = 0.7071067811865476; | 264 let SQRT1_2 = 0.7071067811865476; |
| 265 let SQRT2 = 1.4142135623730951; | 265 let SQRT2 = 1.4142135623730951; |
| 266 function min(a, b) { | 266 function min(a, b) { |
| 267 if (!dart.is(a, core.num)) | 267 if (!dart.is(a, core.num)) |
| 268 throw new core.ArgumentError(a); | 268 dart.throw(new core.ArgumentError(a)); |
| 269 if (!dart.is(b, core.num)) | 269 if (!dart.is(b, core.num)) |
| 270 throw new core.ArgumentError(b); | 270 dart.throw(new core.ArgumentError(b)); |
| 271 if (dart.notNull(a) > dart.notNull(b)) | 271 if (dart.notNull(a) > dart.notNull(b)) |
| 272 return b; | 272 return b; |
| 273 if (dart.notNull(a) < dart.notNull(b)) | 273 if (dart.notNull(a) < dart.notNull(b)) |
| 274 return a; | 274 return a; |
| 275 if (typeof b == 'number') { | 275 if (typeof b == 'number') { |
| 276 if (typeof a == 'number') { | 276 if (typeof a == 'number') { |
| 277 if (a == 0.0) { | 277 if (a == 0.0) { |
| 278 return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.no
tNull(b); | 278 return (dart.notNull(a) + dart.notNull(b)) * dart.notNull(a) * dart.no
tNull(b); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 if (a == 0 && dart.notNull(b[dartx.isNegative]) || dart.notNull(b[dartx.is
NaN])) | 281 if (a == 0 && dart.notNull(b[dartx.isNegative]) || dart.notNull(b[dartx.is
NaN])) |
| 282 return b; | 282 return b; |
| 283 return a; | 283 return a; |
| 284 } | 284 } |
| 285 return a; | 285 return a; |
| 286 } | 286 } |
| 287 dart.fn(min, core.num, [core.num, core.num]); | 287 dart.fn(min, core.num, [core.num, core.num]); |
| 288 function max(a, b) { | 288 function max(a, b) { |
| 289 if (!dart.is(a, core.num)) | 289 if (!dart.is(a, core.num)) |
| 290 throw new core.ArgumentError(a); | 290 dart.throw(new core.ArgumentError(a)); |
| 291 if (!dart.is(b, core.num)) | 291 if (!dart.is(b, core.num)) |
| 292 throw new core.ArgumentError(b); | 292 dart.throw(new core.ArgumentError(b)); |
| 293 if (dart.notNull(a) > dart.notNull(b)) | 293 if (dart.notNull(a) > dart.notNull(b)) |
| 294 return a; | 294 return a; |
| 295 if (dart.notNull(a) < dart.notNull(b)) | 295 if (dart.notNull(a) < dart.notNull(b)) |
| 296 return b; | 296 return b; |
| 297 if (typeof b == 'number') { | 297 if (typeof b == 'number') { |
| 298 if (typeof a == 'number') { | 298 if (typeof a == 'number') { |
| 299 if (a == 0.0) { | 299 if (a == 0.0) { |
| 300 return dart.notNull(a) + dart.notNull(b); | 300 return dart.notNull(a) + dart.notNull(b); |
| 301 } | 301 } |
| 302 } | 302 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 function log(x) { | 354 function log(x) { |
| 355 return Math.log(_js_helper.checkNum(x)); | 355 return Math.log(_js_helper.checkNum(x)); |
| 356 } | 356 } |
| 357 dart.fn(log, core.double, [core.num]); | 357 dart.fn(log, core.double, [core.num]); |
| 358 let _POW2_32 = 4294967296; | 358 let _POW2_32 = 4294967296; |
| 359 class _JSRandom extends core.Object { | 359 class _JSRandom extends core.Object { |
| 360 _JSRandom() { | 360 _JSRandom() { |
| 361 } | 361 } |
| 362 nextInt(max) { | 362 nextInt(max) { |
| 363 if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32))
{ | 363 if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32))
{ |
| 364 throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${ma
x}`); | 364 dart.throw(new core.RangeError(`max must be in range 0 < max ≤ 2^32, was
${max}`)); |
| 365 } | 365 } |
| 366 return Math.random() * max >>> 0; | 366 return Math.random() * max >>> 0; |
| 367 } | 367 } |
| 368 nextDouble() { | 368 nextDouble() { |
| 369 return Math.random(); | 369 return Math.random(); |
| 370 } | 370 } |
| 371 nextBool() { | 371 nextBool() { |
| 372 return Math.random() < 0.5; | 372 return Math.random() < 0.5; |
| 373 } | 373 } |
| 374 } | 374 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 let tmpLoHi = dart.notNull(tmpLo) - dart.notNull(tmpLoLo); | 448 let tmpLoHi = dart.notNull(tmpLo) - dart.notNull(tmpLoLo); |
| 449 let newLo = dart.notNull(tmpLoLo) + dart.notNull(tmpHiLo) + dart.notNull(t
his[_hi]); | 449 let newLo = dart.notNull(tmpLoLo) + dart.notNull(tmpHiLo) + dart.notNull(t
his[_hi]); |
| 450 this[_lo] = dart.notNull(newLo) & dart.notNull(_Random._MASK32); | 450 this[_lo] = dart.notNull(newLo) & dart.notNull(_Random._MASK32); |
| 451 let newLoHi = dart.notNull(newLo) - dart.notNull(this[_lo]); | 451 let newLoHi = dart.notNull(newLo) - dart.notNull(this[_lo]); |
| 452 this[_hi] = ((dart.notNull(tmpLoHi) + dart.notNull(tmpHiHi) + dart.notNull
(newLoHi)) / dart.notNull(_POW2_32)).truncate() & dart.notNull(_Random._MASK32); | 452 this[_hi] = ((dart.notNull(tmpLoHi) + dart.notNull(tmpHiHi) + dart.notNull
(newLoHi)) / dart.notNull(_POW2_32)).truncate() & dart.notNull(_Random._MASK32); |
| 453 dart.assert(dart.notNull(this[_lo]) < dart.notNull(_POW2_32)); | 453 dart.assert(dart.notNull(this[_lo]) < dart.notNull(_POW2_32)); |
| 454 dart.assert(dart.notNull(this[_hi]) < dart.notNull(_POW2_32)); | 454 dart.assert(dart.notNull(this[_hi]) < dart.notNull(_POW2_32)); |
| 455 } | 455 } |
| 456 nextInt(max) { | 456 nextInt(max) { |
| 457 if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32))
{ | 457 if (dart.notNull(max) <= 0 || dart.notNull(max) > dart.notNull(_POW2_32))
{ |
| 458 throw new core.RangeError(`max must be in range 0 < max ≤ 2^32, was ${ma
x}`); | 458 dart.throw(new core.RangeError(`max must be in range 0 < max ≤ 2^32, was
${max}`)); |
| 459 } | 459 } |
| 460 if ((dart.notNull(max) & dart.notNull(max) - 1) == 0) { | 460 if ((dart.notNull(max) & dart.notNull(max) - 1) == 0) { |
| 461 this[_nextState](); | 461 this[_nextState](); |
| 462 return dart.notNull(this[_lo]) & dart.notNull(max) - 1; | 462 return dart.notNull(this[_lo]) & dart.notNull(max) - 1; |
| 463 } | 463 } |
| 464 let rnd32 = null; | 464 let rnd32 = null; |
| 465 let result = null; | 465 let result = null; |
| 466 do { | 466 do { |
| 467 this[_nextState](); | 467 this[_nextState](); |
| 468 rnd32 = this[_lo]; | 468 rnd32 = this[_lo]; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 exports.sin = sin; | 518 exports.sin = sin; |
| 519 exports.cos = cos; | 519 exports.cos = cos; |
| 520 exports.tan = tan; | 520 exports.tan = tan; |
| 521 exports.acos = acos; | 521 exports.acos = acos; |
| 522 exports.asin = asin; | 522 exports.asin = asin; |
| 523 exports.atan = atan; | 523 exports.atan = atan; |
| 524 exports.sqrt = sqrt; | 524 exports.sqrt = sqrt; |
| 525 exports.exp = exp; | 525 exports.exp = exp; |
| 526 exports.log = log; | 526 exports.log = log; |
| 527 }); | 527 }); |
| OLD | NEW |