Code coverage report for nodash/lib/floating.js

Statements: 100% (15 / 15)      Branches: 100% (18 / 18)      Functions: 100% (8 / 8)      Lines: 100% (15 / 15)      Ignored: none     

All files » nodash/lib/ » floating.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68      1   5                 13                                   6       6 2 4 2   2         2       6 2   4         6       2          
/* vim: set et sw=2 ts=2: */
'use strict';
 
module.exports = [ 'Math', function (Math) {
 
  return {
 
    exp: Math.exp,
 
    sqrt: Math.sqrt,
 
    log: Math.log,
 
    logBase: function (a, b) {
      return Math.log(a) / Math.log(b);
    },
 
    '** pow ^ ^^': Math.pow,
 
    sin: Math.sin,
 
    tan: Math.tan,
 
    cos: Math.cos,
 
    asin: Math.asin,
 
    atan: Math.atan,
 
    acos: Math.acos,
 
    sinh: Math.sinh || function (x) {
      return (Math.exp(x) - Math.exp(-x)) / 2;
    },
 
    tanh: Math.tanh || function (x) {
      if (x === Infinity) {
        return 1;
      } else if (x === -Infinity) {
        return -1;
      } else {
        return (Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x));
      }
    },
 
    cosh: Math.cosh || function (x) {
      return (Math.exp(x) + Math.exp(-x)) / 2;
    },
 
    asinh: Math.asinh || function (x) {
      if (x === -Infinity) {
        return x;
      } else {
        return Math.log(x + Math.sqrt(x * x + 1));
      }
    },
 
    atanh: Math.atanh || function (x) {
      return Math.log((1 + x) / (1 - x)) / 2;
    },
 
    acosh: Math.acosh || function (x) {
      return Math.log(x + Math.sqrt(x * x - 1));
    }
 
  };
}];