summaryrefslogtreecommitdiff
path: root/scss/tests
diff options
context:
space:
mode:
authorEevee (Lexy Munroe) <eevee.git@veekun.com>2016-06-08 18:43:11 -0700
committerEevee (Lexy Munroe) <eevee.git@veekun.com>2016-06-08 18:43:11 -0700
commit9ea91782b4b4dacc144454db14c32e9302e9347b (patch)
treed5eef8f47153aeba3ce3c077829b946203917ac9 /scss/tests
parent8ded7bef22819a080299a3b0dd32fd08b8dbdff7 (diff)
downloadpyscss-9ea91782b4b4dacc144454db14c32e9302e9347b.tar.gz
Avoid precision loss when converting between units. Fixes #330
Diffstat (limited to 'scss/tests')
-rw-r--r--scss/tests/files/bugs/unit-float-precision.css3
-rw-r--r--scss/tests/files/bugs/unit-float-precision.scss7
2 files changed, 10 insertions, 0 deletions
diff --git a/scss/tests/files/bugs/unit-float-precision.css b/scss/tests/files/bugs/unit-float-precision.css
new file mode 100644
index 0000000..16e9d86
--- /dev/null
+++ b/scss/tests/files/bugs/unit-float-precision.css
@@ -0,0 +1,3 @@
+a {
+ width: 702px;
+}
diff --git a/scss/tests/files/bugs/unit-float-precision.scss b/scss/tests/files/bugs/unit-float-precision.scss
new file mode 100644
index 0000000..a57b294
--- /dev/null
+++ b/scss/tests/files/bugs/unit-float-precision.scss
@@ -0,0 +1,7 @@
+// A number of pixels is actually stored internally as millimeters, which
+// causes some slight precision issues in corner cases. In this case, the
+// answer came out as 701px rather than 702px, because the subtraction yielded
+// 701.99999999px.
+a {
+ width: floor(742px - 40px);
+}