Sha256: 5f947806bfa0c2faa19a7438d16645146bca8b433449c66e9a307ffd0e69ef85
Contents?: true
Size: 344 Bytes
Versions: 106
Compression:
Stored size: 344 Bytes
Contents
// Returns $x * 2^$exp // @param {Number} $x // @param {Number} $exp @function ldexp ($x, $exp) { $b: if($exp >= 0, 2, 1 / 2); @if $exp < 0 { $exp: $exp * -1; } @while $exp > 0 { @if $exp % 2 == 1 { $x: $x * $b; } $b: $b * $b; $exp: floor($exp * 0.5); } @return $x; }
Version data entries
106 entries across 106 versions & 3 rubygems