// MathSass Tests
// ==============

@include describe('Pow [function]') {
  @include it('should calculate exponents') {
    @include assert-equal(
      _acc-pow(4, 2),
      16
    );
  }

  @include it('should handle zero correctly') {
    @include assert-equal(
      _acc-pow(0, 0),
      1
    );
    @include assert-equal(
      _acc-pow(3.5, 0),
      1
    );
    @include assert-equal(
      _acc-pow(0, 3.5),
      0
    );
  }

  @include it('should calculate negative exponents') {
    @include assert-equal(
      _acc-pow(4, -2),
      0.0625
    );
  }

  @include it('should calculate decimal exponents') {
    @include assert-equal(
      _acc-pow(4, 0.2),
      1.31951,
      $inspect: true
    );
  }
}


@include describe('Log [function]') {
  @include it('should calculate the natural logarithm of a number') {
    @include assert-equal(
      _acc-log(2),
      0.69315,
      $inspect: true
    );
    @include assert-equal(
      _acc-log(10),
      2.30259,
      $inspect: true
    );
    @include assert-equal(
      _acc-log(2, 10),
      0.30103,
      $inspect: true
    );
  }

  @include it('should calculate the natural logarithm of a large fractional number') {
    @include assert-equal(
      _acc-log(12345.678),
      9.421061,
      $inspect: true
    );
  }

  @include it('should calculate the natural logarithm of a small fractional number') {
    @include assert-equal(
      _acc-log(0.0001),
      -9.21034,
      $inspect: true
    );
  }
}


@include describe('Frexp [function]') {
  @include it('should return two item list containing the normalized fraction and exponent of number') {
    @include assert-equal(
      _acc-frexp(2),
      (0.5, 2)
    );
    @include assert-equal(
      _acc-frexp(5),
      (0.625, 3)
    );
  }
}


@include describe('Ldxp [function]') {
  @include it('should calculate ldexp') {
    @include assert-equal(
      _acc-ldexp(2, 1),
      4
    );
    @include assert-equal(
      _acc-ldexp(5, 2),
      20x
    );
  }

  @include it('should calculate ldexp with negative exp') {
    @include assert-equal(
      _acc-ldexp(2, -1),
      1
    );
    @include assert-equal(
      _acc-ldexp(5, -2),
      1.25
    );
  }
}

