Sha256: a21cbef7c4e6c8ebffa50b5173fd9f347feafbf3c7a6c4f26d0b688a3314bebf

Contents?: true

Size: 385 Bytes

Versions: 106

Compression:

Stored size: 385 Bytes

Contents

// Returns the square root of a number.
// @param {Number} $x
// @example
//     sqrt(2) // 1.41421
//     sqrt(5) // 2.23607
@function sqrt ($x) {
    @if $x < 0 {
        @warn "Argument for `sqrt()` must be a positive number.";
        @return null;
    }
    $ret: 1;
    @for $i from 1 through 24 {
        $ret: $ret - (pow($ret, 2) - $x) / (2 * $ret);
    }
    @return $ret;
}

Version data entries

106 entries across 106 versions & 3 rubygems

Version Path
decidim-admin-0.19.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.17.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.18.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.17.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.16.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.17.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.16.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.15.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.15.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.15.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.14.4 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.14.3 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.14.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.14.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.13.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.12.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.13.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.12.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.13.0.pre1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss
decidim-admin-0.12.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss