Skip to content

Commit 8c08fa4

Browse files
committed
NaN is invalid a compute time, so OK at parsing time, maybe add a warning?
This should fix #469
1 parent a17ee1c commit 8c08fa4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

org/w3c/css/values/CssNumber.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void set(String s, ApplContext ac)
8686
_strval = "e";
8787
break;
8888
case "infinity":
89-
value = BigDecimal.valueOf(Double.POSITIVE_INFINITY);
89+
value = BigDecimal.valueOf(Double.MAX_VALUE);
9090
isInt = true;
9191
_strval = "infinity";
9292
break;
@@ -109,6 +109,12 @@ public void set(String s, ApplContext ac)
109109
isInt = true;
110110
_strval = val.toLowerCase();
111111
break;
112+
case "nan":
113+
// FIXME add warning that this iss invalid at compute time?
114+
value = BigDecimal.valueOf(Long.MAX_VALUE);
115+
isInt = false;
116+
_strval = "NaN";
117+
break;
112118
default:
113119
value = new BigDecimal(val);
114120
isInt = (val.indexOf('.') < 0);

0 commit comments

Comments
 (0)