@@ -354,54 +354,106 @@ declare class Set<T> {
354
354
}
355
355
356
356
interface IMath < T > {
357
+ /** The base of natural logarithms, e, approximately 2.718. */
357
358
readonly E : T ;
359
+ /** The natural logarithm of 2, approximately 0.693. */
358
360
readonly LN2 : T ;
361
+ /** The natural logarithm of 10, approximately 2.302. */
359
362
readonly LN10 : T ;
363
+ /** The base 2 logarithm of e, approximately 1.442. */
360
364
readonly LOG2E : T ;
365
+ /** The base 10 logarithm of e, approximately 0.434. */
361
366
readonly LOG10E : T ;
367
+ /** The ratio of the circumference of a circle to its diameter, approximately 3.14159. */
362
368
readonly PI : T ;
369
+ /** The square root of 1/2, approximately 0.707. */
363
370
readonly SQRT1_2 : T ;
371
+ /** The square root of 2, approximately 1.414. */
364
372
readonly SQRT2 : T ;
373
+ /** Returns the absolute value of `x`. */
365
374
abs ( x : T ) : T ;
375
+ /** Returns the arccosine (in radians) of `x`. */
366
376
acos ( x : T ) : T ;
377
+ /** Returns the hyperbolic arc-cosine of `x`. */
367
378
acosh ( x : T ) : T ;
379
+ /** Returns the arcsine (in radians) of `x` */
368
380
asin ( x : T ) : T ;
381
+ /** Returns the hyperbolic arcsine of `x`. */
369
382
asinh ( x : T ) : T ;
383
+ /** Returns the arctangent (in radians) of `x`. */
370
384
atan ( x : T ) : T ;
385
+ /** Returns the arctangent of the quotient of its arguments. */
371
386
atan2 ( y : T , x : T ) : T ;
387
+ /** Returns the hyperbolic arctangent of `x`. */
372
388
atanh ( x : T ) : T ;
389
+ /** Returns the cube root of `x`. */
373
390
cbrt ( x : T ) : T ;
391
+ /** Returns the smallest integer greater than or equal to `x`. */
374
392
ceil ( x : T ) : T ;
393
+ /** Returns the number of leading zero bits in the 32-bit binary representation of `x`. */
375
394
clz32 ( x : T ) : i32 ;
395
+ /** Returns the cosine (in radians) of `x`. */
376
396
cos ( x : T ) : T ;
397
+ /** Returns the hyperbolic cosine of `x`. */
377
398
cosh ( x : T ) : T ;
399
+ /** Returns e to the power of `x`. */
378
400
exp ( x : T ) : T ;
401
+ /** Returns e to the power of `x`, minus 1. */
379
402
expm1 ( x : T ) : T ;
403
+ /** Returns the largest integer less than or equal to `x`. */
380
404
floor ( x : T ) : T ;
405
+ /** Returns the nearest 32-bit single precision float representation of `x`. */
381
406
fround ( x : T ) : f32 ;
407
+ /** Returns the square root of the sum of squares of its arguments. */
382
408
hypot ( value1 : T , value2 : T ) : T ; // TODO: rest
409
+ /** Returns the result of the C-like 32-bit multiplication of `a` and `b`. */
383
410
imul ( a : T , b : T ) : i32 ;
411
+ /** Returns the natural logarithm (base e) of `x`. */
384
412
log ( x : T ) : T ;
413
+ /** Returns the base 10 logarithm of `x`. */
385
414
log10 ( x : T ) : T ;
415
+ /** Returns the natural logarithm (base e) of 1 + `x`. */
386
416
log1p ( x : T ) : T ;
417
+ /** Returns the base 2 logarithm of `x`. */
387
418
log2 ( x : T ) : T ;
419
+ /** Returns the largest-valued number of its arguments. */
388
420
max ( value1 : T , value2 : T ) : T ; // TODO: rest
421
+ /** Returns the lowest-valued number of its arguments. */
389
422
min ( value1 : T , value2 : T ) : T ; // TODO: rest
423
+ /** Returns `base` to the power of `exponent`. */
390
424
pow ( base : T , exponent : T ) : T ;
425
+ /** Returns a pseudo-random number in the range from 0.0 inclusive up to but not including 1.0. */
391
426
random ( ) : T ;
427
+ /** Returns the value of `x` rounded to the nearest integer. */
392
428
round ( x : T ) : T ;
429
+ /** Returns the sign of `x`, indicating whether the number is positive, negative or zero. */
393
430
sign ( x : T ) : T ;
431
+ /** Returns the sine of `x`. */
394
432
sin ( x : T ) : T ;
433
+ /** Returns the hyperbolic sine of `x`. */
395
434
sinh ( x : T ) : T ;
435
+ /** Returns the square root of `x`. */
396
436
sqrt ( x : T ) : T ;
437
+ /** Returns the tangent of `x`. */
397
438
tan ( x : T ) : T ;
439
+ /** Returns the hyperbolic tangent of `x`. */
398
440
tanh ( x : T ) : T ;
441
+ /** Returns the integer part of `x` by removing any fractional digits. */
399
442
trunc ( x : T ) : T ;
400
443
}
401
444
445
+ interface ISeedRandom {
446
+ /** Seeds the random number generator. */
447
+ seedRandom ( value : i64 ) : void ;
448
+ }
449
+
450
+ /** Double precision math imported from JavaScript. */
402
451
declare const JSMath : IMath < f64 > ;
403
- declare const NativeMath : IMath < f64 > ;
452
+ /** Double precision math implemented natively. */
453
+ declare const NativeMath : IMath < f64 > & ISeedRandom ;
454
+ /** Single precision math implemented natively. */
404
455
declare const NativeMathf : IMath < f32 > ;
456
+ /** Alias of {@link NativeMath} or {@link JSMath} respectively. Defaults to `NativeMath`. */
405
457
declare const Math : IMath < f64 > ;
406
458
407
459
// Internal decorators
0 commit comments