1 'use strict'; 2 3 Number.prototype.pow=function(n){ 4 /**Возвращает число в степени n*/ 5 return Math.pow(this,n); 6 } 7 8 Number.prototype.sqrt=function(){ 9 /**Квадратный корень из числа.*/ 10 return Math.sqrt(this); 11 } 12 13 Number.prototype.sqr=function(){ 14 /**Квадрат числа.*/ 15 return Math.pow(this,2); 16 } 17 Number.prototype.abs=function(){ 18 /**Модуль числа.*/ 19 return Math.abs(this); 20 } 21 22 Number.prototype.floor=function(){ 23 /**Округлить число до целых в меньшую сторону.*/ 24 return Math.floor(this); 25 } 26 27 Number.prototype.ceil=function(){ 28 /**Округлить число до целых в большую сторону.*/ 29 return Math.ceil(this); 30 } 31 32 Number.prototype.arctg= 33 Number.prototype.atan=function(){ 34 /**Арктангенс числа.*/ 35 return Math.atan(this); 36 } 37 38 Number.prototype.arcsin= 39 Number.prototype.asin=function(){ 40 /**Арксинус числа.*/ 41 return Math.asin(this); 42 } 43 44 Number.prototype.arccos= 45 Number.prototype.acos=function(){ 46 /**Арккосинус числа.*/ 47 return Math.acos(this); 48 } 49 50 Number.prototype.arcctg=function(){ 51 /**Аркотангенс числа.*/ 52 return Math.atan(1/this); 53 } 54 55 Number.prototype.sin=function(){ 56 /**Синус числа.*/ 57 return Math.sin(this); 58 } 59 60 Number.prototype.cos=function(){ 61 /**Косинус числа.*/ 62 return Math.cos(this); 63 } 64 65 Number.prototype.tg= 66 Number.prototype.tan=function(){ 67 /**Тангенс числа.*/ 68 return Math.tan(this); 69 } 70 71 Number.prototype.ctg=function(){ 72 /**Котангенс числа.*/ 73 return 1/Math.tan(this); 74 } 75 76 Number.prototype.round=function(){ 77 /**Округление числа до целых.*/ 78 return Math.round(this); 79 } 80 81 Number.prototype.addToGlobal('docsNumber',1); 82