Sha256: dfa6715e8b54b7e640cd6e02aeb61e3320cd54477ca6613087f6ea54627eb4f8

Contents?: true

Size: 417 Bytes

Versions: 31

Compression:

Stored size: 417 Bytes

Contents

// Returns a two-element list containing the normalized fraction and exponent of number.
// @param {Number} $x
// @return {List} fraction, exponent
@function frexp ($x){
  $exp: 0;

  @if $x < 0{
    $x: $x * -1;
  }

  @if $x < .5{
    @while $x < .5{
      $x: $x * 2;
      $exp: $exp - 1;
    }
  }
  @else if $x >= 1{
    @while $x >= 1{
      $x: $x * .5;
      $exp: $exp + 1;
    }
  }

  @return $x, $exp;
}

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-admin-0.27.9 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.8 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.7 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.6 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.10 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.9 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.5 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.8 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.4 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.3 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.7 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.5 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.1 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.4 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.0 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.3 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.0.rc2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.27.0.rc1 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss
decidim-admin-0.26.2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss