Sha256: e48666584a8efc51f9e87448b3c5d997e10c3a7f21050387fcb8dc81a7aab1c2
Contents?: true
Size: 385 Bytes
Versions: 31
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 @use "sass:math"; @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 - math.div(pow($ret, 2) - $x, 2 * $ret); } @return $ret; }
Version data entries
31 entries across 31 versions & 1 rubygems