Nodejs Number Calculate sin()

Here you can find the source of sin()

Method Source Code

Number.prototype.sin = function() {
    return Math.sin(this);
}

Related

  1. set(key, value)
    'use strict';
    const assert = require('assert');
    const nan = Symbol('NaN');
    const define = Object.defineProperty;
    Number.prototype[nan] = Object.create(null);
    Number.prototype.set = function (key, value) {
      if (null == this || !isNaN(this)) { return this; }
      const space = this[nan];
      const accessor = {
    ...
    
  2. setInCirclesetInCircle(lower, upper)
    Number.prototype.setInCircle = function setInCircle(lower, upper){
      var zahl = this;
      if (lower === upper){
        return lower;
      if (lower > upper){
        var l = lower;
        lower = upper;
        upper = l;
    ...
    
  3. setInRangesetInRange(lower, upper)
    Number.prototype.setInRange = function setInRange(lower, upper){
      if (typeof lower === "undefined" || lower === null){
        lower = this;
      if (typeof upper === "undefined" || upper === null){
        upper = this;
      lower = parseFloat(lower) || 0;
      upper = parseFloat(upper) || 0;
    ...
    
  4. sigFig(precision)
    'use strict'
    Number.prototype.sigFig = function(precision){
        if( !precision ) precision = 2;
        var d = Math.pow(10, precision);
        return ( parseInt( this.valueOf() * d) / d ).toFixed(precision);
    };
    
  5. simEq(number, digits)
    DEFAULT_DIGIT = 5;
    Number.prototype.simEq = function(number, digits) {
      digits = digits == undefined ? DEFAULT_DIGIT : digits;
      var n1 = this.toFixed(digits);
      var n2 = number.toFixed(digits);
      if (n1 == -0)
        n1 = 0;
      if (n2 == -0)
        n2 = 0;
    ...
    
  6. smallerThan(num)
    Number.prototype.smallerThan = function(num) {
        return this < num;
    
  7. snap(resolution)
    Number.prototype.snap = function(resolution) {
      return Math.floor(this / resolution) * resolution;
    };
    
  8. sqrt()
    Number.prototype.sqrt = function() {
      return Math.sqrt(this);
    };
    
  9. square()
    var expect = chai.expect;
    Number.prototype.square = function () {
        "use strict";
        return this * this;
    };