Skip to content

Commit

Permalink
Add specs for universal floating-point numbers (#1826)
Browse files Browse the repository at this point in the history
Closes #1819
  • Loading branch information
nex3 committed Sep 21, 2022
1 parent 4bae480 commit 2b1ffab
Show file tree
Hide file tree
Showing 19 changed files with 432 additions and 90 deletions.
2 changes: 1 addition & 1 deletion spec/core_functions/math/acos.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ a {b: math.acos(1.000000000001)}

<===> one_fuzzy/output.css
a {
b: 0deg;
b: NaNdeg;
}

<===>
Expand Down
7 changes: 3 additions & 4 deletions spec/core_functions/math/asin.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ a {b: math.asin(-0.000000000001)}

<===> negative_zero_fuzzy/output.css
a {
b: 0deg;
b: -0.0000000001deg;
}

<===>
Expand All @@ -66,10 +66,9 @@ a {b: math.asin(0.000000000001)}

<===> zero_fuzzy/output.css
a {
b: 0deg;
b: 0.0000000001deg;
}


<===>
================================================================================
<===> decimal/input.scss
Expand Down Expand Up @@ -100,7 +99,7 @@ a {b: math.asin(1.000000000001)}

<===> one_fuzzy/output.css
a {
b: 90deg;
b: NaNdeg;
}

<===>
Expand Down
4 changes: 2 additions & 2 deletions spec/core_functions/math/atan.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ a {b: math.atan(-0.000000000001)}

<===> negative_zero_fuzzy/output.css
a {
b: 0deg;
b: -0.0000000001deg;
}

<===>
Expand All @@ -66,7 +66,7 @@ a {b: math.atan(0.000000000001)}

<===> zero_fuzzy/output.css
a {
b: 0deg;
b: 0.0000000001deg;
}

<===>
Expand Down
8 changes: 4 additions & 4 deletions spec/core_functions/math/atan2/y_non_zero_finite.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ a {b: math.atan2(-1, -0.000000000001)}

<===> negative/with_x/negative_zero_fuzzy/output.css
a {
b: -90deg;
b: -90.0000000001deg;
}

<===>
Expand All @@ -59,7 +59,7 @@ a {b: math.atan2(-1, 0.000000000001)}

<===> negative/with_x/zero_fuzzy/output.css
a {
b: -90deg;
b: -89.9999999999deg;
}

<===>
Expand Down Expand Up @@ -125,7 +125,7 @@ a {b: math.atan2(1, -0.000000000001)}

<===> positive/with_x/negative_zero_fuzzy/output.css
a {
b: 90deg;
b: 90.0000000001deg;
}

<===>
Expand All @@ -147,7 +147,7 @@ a {b: math.atan2(1, 0.000000000001)}

<===> positive/with_x/zero_fuzzy/output.css
a {
b: 90deg;
b: 89.9999999999deg;
}

<===>
Expand Down
16 changes: 8 additions & 8 deletions spec/core_functions/math/atan2/y_zero.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ a {b: math.atan2(-0.000000000001, -1)}

<===> negative_fuzzy/with_x/negative_finite/output.css
a {
b: -180deg;
b: -179.9999999999deg;
}

<===>
Expand All @@ -114,7 +114,7 @@ a {b: math.atan2(-0.000000000001, -0.0)}

<===> negative_fuzzy/with_x/negative_zero/output.css
a {
b: -180deg;
b: -90deg;
}

<===>
Expand All @@ -125,7 +125,7 @@ a {b: math.atan2(-0.000000000001, 0)}

<===> negative_fuzzy/with_x/zero/output.css
a {
b: 0deg;
b: -90deg;
}

<===>
Expand All @@ -136,7 +136,7 @@ a {b: math.atan2(-0.000000000001, 1)}

<===> negative_fuzzy/with_x/finite/output.css
a {
b: 0deg;
b: -0.0000000001deg;
}

<===>
Expand Down Expand Up @@ -257,7 +257,7 @@ a {b: math.atan2(0.000000000001, -1)}

<===> positive_fuzzy/with_x/negative_finite/output.css
a {
b: 180deg;
b: 179.9999999999deg;
}

<===>
Expand All @@ -268,7 +268,7 @@ a {b: math.atan2(0.000000000001, -0.0)}

<===> positive_fuzzy/with_x/negative_zero/output.css
a {
b: 180deg;
b: 90deg;
}

<===>
Expand All @@ -279,7 +279,7 @@ a {b: math.atan2(0.000000000001, 0)}

<===> positive_fuzzy/with_x/zero/output.css
a {
b: 0deg;
b: 90deg;
}

<===>
Expand All @@ -290,7 +290,7 @@ a {b: math.atan2(0.000000000001, 1)}

<===> positive_fuzzy/with_x/finite/output.css
a {
b: 0deg;
b: 0.0000000001deg;
}

<===>
Expand Down
6 changes: 3 additions & 3 deletions spec/core_functions/math/log.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ a {b: math.log(0.000000000001)}

<===> zero_fuzzy/output.css
a {
b: -Infinity;
b: -27.6310211159;
}

<===>
Expand Down Expand Up @@ -99,7 +99,7 @@ a {b: math.log(2, 0.000000000001)}

<===> base/zero_fuzzy/output.css
a {
b: 0;
b: -0.025085833;
}

<===>
Expand Down Expand Up @@ -132,7 +132,7 @@ a {b: math.log(2, 1.000000000001)}

<===> base/one_fuzzy/output.css
a {
b: Infinity;
b: 693085564849.9645;
}

<===>
Expand Down
8 changes: 4 additions & 4 deletions spec/core_functions/math/pow/base_greater_than_zero.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ a {b: math.pow(1, math.div(-1, 0))}

<===> base/one/with_exponent/negative_infinity/output.css
a {
b: NaN;
b: 1;
}

<===>
Expand All @@ -37,7 +37,7 @@ a {b: math.pow(1, math.div(1, 0))}

<===> base/one/with_exponent/infinity/output.css
a {
b: NaN;
b: 1;
}

<===>
Expand All @@ -48,7 +48,7 @@ a {b: math.pow(1.000000000001, math.div(-1, 0))}

<===> base/one_fuzzy/with_exponent/negative_infinity/output.css
a {
b: NaN;
b: 0;
}

<===>
Expand All @@ -59,7 +59,7 @@ a {b: math.pow(1.000000000001, math.div(1, 0))}

<===> base/one_fuzzy/with_exponent/infinity/output.css
a {
b: NaN;
b: Infinity;
}

<===>
Expand Down
12 changes: 6 additions & 6 deletions spec/core_functions/math/pow/base_less_than_zero.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ a {b: math.pow(-1, math.div(-1, 0))}

<===> base/negative_one/with_exponent/negative_infinity/output.css
a {
b: NaN;
b: 1;
}

<===>
Expand All @@ -37,7 +37,7 @@ a {b: math.pow(-1, math.div(1, 0))}

<===> base/negative_one/with_exponent/infinity/output.css
a {
b: NaN;
b: 1;
}

<===>
Expand All @@ -48,7 +48,7 @@ a {b: math.pow(-1.000000000001, math.div(-1, 0))}

<===> base/negative_one_fuzzy/with_exponent/negative_infinity/output.css
a {
b: NaN;
b: 0;
}

<===>
Expand All @@ -59,7 +59,7 @@ a {b: math.pow(-1.000000000001, math.div(1, 0))}

<===> base/negative_one_fuzzy/with_exponent/infinity/output.css
a {
b: NaN;
b: Infinity;
}

<===>
Expand Down Expand Up @@ -92,7 +92,7 @@ a {b: math.pow(-2, 0.000000000001)}

<===> base/less_than_negative_one/with_exponent/zero_fuzzy/output.css
a {
b: 1;
b: NaN;
}

<===>
Expand All @@ -114,7 +114,7 @@ a {b: math.pow(-2, 2.000000000001)}

<===> base/less_than_negative_one/with_exponent/integer_fuzzy/output.css
a {
b: 4;
b: NaN;
}

<===>
Expand Down
4 changes: 2 additions & 2 deletions spec/core_functions/math/pow/base_negative_infinity.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ a {b: math.pow(math.div(-1, 0), 0.000000000001)}

<===> with_exponent/zero_fuzzy/output.css
a {
b: 1;
b: Infinity;
}

<===>
Expand Down Expand Up @@ -125,7 +125,7 @@ a {b: math.pow(math.div(-1, 0), 3.000000000001)}

<===> with_exponent/odd_integer_fuzzy/output.css
a {
b: -Infinity;
b: Infinity;
}

<===>
Expand Down
12 changes: 6 additions & 6 deletions spec/core_functions/math/pow/base_negative_zero.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ a {b: math.pow(-0.0, -3.000000000001)}

<===> with_exponent/negative_odd_integer_fuzzy/output.css
a {
b: -Infinity;
b: Infinity;
}

<===>
Expand Down Expand Up @@ -81,7 +81,7 @@ a {b: math.pow(-0.0, 0.000000000001)}

<===> with_exponent/zero_fuzzy/output.css
a {
b: 1;
b: 0;
}

<===>
Expand Down Expand Up @@ -169,7 +169,7 @@ a {b: math.pow(-0.000000000001, -2)}

<===> fuzzy/with_exponent/negative_even_integer/output.css
a {
b: Infinity;
b: 1000000000000000000000000;
}

<===>
Expand All @@ -180,7 +180,7 @@ a {b: math.pow(-0.000000000001, -3)}

<===> fuzzy/with_exponent/negative_odd_integer/output.css
a {
b: -Infinity;
b: -1000000000000000000000000000000000000;
}

<===>
Expand All @@ -191,7 +191,7 @@ a {b: math.pow(-0.000000000001, -0.5)}

<===> fuzzy/with_exponent/negative_decimal/output.css
a {
b: Infinity;
b: NaN;
}

<===>
Expand Down Expand Up @@ -235,7 +235,7 @@ a {b: math.pow(-0.000000000001, 0.5)}

<===> fuzzy/with_exponent/decimal/output.css
a {
b: 0;
b: NaN;
}

<===>
Expand Down
2 changes: 1 addition & 1 deletion spec/core_functions/math/pow/base_positive_infinity.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ a {b: math.pow(math.div(1, 0), 0.000000000001)}

<===> with_exponent/zero_fuzzy/output.css
a {
b: 1;
b: Infinity;
}

<===>
Expand Down
Loading

0 comments on commit 2b1ffab

Please sign in to comment.