summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-10-08 18:01:10 (GMT)
committerGitHub <noreply@github.com>2018-10-08 18:01:10 (GMT)
commit12a36e17164f1ed3e5eee566055fa6a2627cedbb (patch)
treeb7076ae733e9effee29ef8b4145dd75bb956e039 /generic
parent52df9347d4a8e653659da20f99780076e0dd68aa (diff)
parent656c05f8c8041208477226ea20ecb2b5403683c6 (diff)
downloadblt-12a36e17164f1ed3e5eee566055fa6a2627cedbb.zip
blt-12a36e17164f1ed3e5eee566055fa6a2627cedbb.tar.gz
blt-12a36e17164f1ed3e5eee566055fa6a2627cedbb.tar.bz2
Merge pull request #18 from prs-de/NaN-is-NaN
Support NaN as not-a-number representation
Diffstat (limited to 'generic')
-rw-r--r--generic/tkbltVecCmd.C4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tkbltVecCmd.C b/generic/tkbltVecCmd.C
index 8603d54..7bcfd4f 100644
--- a/generic/tkbltVecCmd.C
+++ b/generic/tkbltVecCmd.C
@@ -162,11 +162,11 @@ static int Blt_ExprDoubleFromObj(Tcl_Interp* interp, Tcl_Obj *objPtr,
if (Tcl_GetDoubleFromObj((Tcl_Interp *)NULL, objPtr, valuePtr) == TCL_OK)
return TCL_OK;
- // Interpret the empty string as NaN
+ // Interpret the empty string "" and "NaN" as NaN.
int length;
char *string;
string = Tcl_GetStringFromObj(objPtr, &length);
- if (length == 0) {
+ if (length == 0 || (length == 3 && strcmp(string, "NaN") == 0)) {
*valuePtr = NAN;
return TCL_OK;
}