Skip to content

Instantly share code, notes, and snippets.

@MThakkar121
Last active July 31, 2019 10:46
Show Gist options
  • Save MThakkar121/31440330cdc43febc178898199a1412a to your computer and use it in GitHub Desktop.
Save MThakkar121/31440330cdc43febc178898199a1412a to your computer and use it in GitHub Desktop.
comment difference
/// Computes an exponent.
///
/// @param {number} $base
/// The number to multiply by itself.
/// @param {integer (unitless)} $exponent
/// The number of `$base`s to multiply together.
/// @return {number} `$base` to the power of `$exponent`.
@function pow($base, $exponent)
$result: 1
@for $_ from 1 through $exponent
$result: $result * $base
@return $result
@MThakkar121
Copy link
Author

/// Computes an exponent. /// /// @param {number} $base /// The number to multiply by itself. /// @param {integer (unitless)} $exponent /// The number of $bases to multiply together. /// @return {number} $baseto the power of$exponent. @function pow($base, $exponent) { $result: 1; @for $_ from 1 through $exponent { $result: $result * $base; } @return $result; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment