Sha256: 6cfd3e45aef0da299d4cfac2e9735c09261810d64b9597ee5e96b37bc1c6b7f3

Contents?: true

Size: 715 Bytes

Versions: 106

Compression:

Stored size: 715 Bytes

Contents

// Returns base to the exponent power.
// @param {Number} $base The base number
// @param {Number} $exp The exponent to which to raise base
// @return {Number}
// @example
//     pow(4, 2)   // 16
//     pow(4, -2)  // 0.0625
//     pow(4, 0.2) // 1.31951
@function pow ($base, $exp) {
    @if $exp == floor($exp) {
        $r: 1;
        $s: 0;
        @if $exp < 0 {
            $exp: $exp * -1;
            $s: 1;
        }
        @while $exp > 0 {
            @if $exp % 2 == 1 {
                $r: $r * $base;
            }
            $exp: floor($exp * 0.5);
            $base: $base * $base;
        }
        @return if($s != 0, 1 / $r, $r);
    } @else {
        @return exp(log($base) * $exp);
    }
}

Version data entries

106 entries across 106 versions & 3 rubygems

Version Path
decidim-admin-0.6.8 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.8 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.7 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.7 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.6 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.6 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.5 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.5 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.4 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.4 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.3 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.3 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.2 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.1 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.6.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.6.0 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-admin-0.5.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss
decidim-0.5.1 decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss