Skip to content

Instantly share code, notes, and snippets.

@napotopia
Created November 6, 2015 13:14
Show Gist options
  • Save napotopia/38eef2af525c4de4f918 to your computer and use it in GitHub Desktop.
Save napotopia/38eef2af525c4de4f918 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@function number($number) {
@return $number / ($number * 0 + 1);
}
@function isInteger ($n) {
@return round($n) == $n;
}
@function lcd($n1, $n2) {
@if (isInteger($n2/$n1)) {
$ln2: $n2/$n1;
$ln1: $n1/$n1;
@return #{$ln1}/#{$ln2};
}
@return #{$n1}/#{$n2};
//$lcd: number($fraction);
//@return $lcd;
}
.foo {
lcd: lcd(4, 10);
int: isInteger(4/11);
}
.foo {
lcd: 4/10;
int: false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment