From 9dedabfa7186ea20bd0615d12b3d8dc55a4f7dbe Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Thu, 19 May 2022 14:38:36 +0200 Subject: [PATCH] Don't rely on Python generating Indet on (float)"-nan" We did the same for vectors. We don't have enough guarantee that Python will return Indet when evaluating float(u"-nan"). --- lslopt/lslbasefuncs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index 558e707..e3c0d15 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -522,6 +522,8 @@ def InternalTypecast(val, out, InList, f32): # # (float)"-nan" produces NaN instead of Indet, even though # # (vector)"<-nan,0,0>" produces . Go figure. # ret = NaN + elif match.group(2): + ret = Indet if match.group(0)[0] == '-' else NaN else: ret = float(match.group(0)) # The following is no longer true as of Server 2022-05-05.571557;