mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
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").
This commit is contained in:
parent
07cf4fe30f
commit
9dedabfa71
1 changed files with 2 additions and 0 deletions
|
@ -522,6 +522,8 @@ def InternalTypecast(val, out, InList, f32):
|
||||||
# # (float)"-nan" produces NaN instead of Indet, even though
|
# # (float)"-nan" produces NaN instead of Indet, even though
|
||||||
# # (vector)"<-nan,0,0>" produces <Indet, 0., 0.>. Go figure.
|
# # (vector)"<-nan,0,0>" produces <Indet, 0., 0.>. Go figure.
|
||||||
# ret = NaN
|
# ret = NaN
|
||||||
|
elif match.group(2):
|
||||||
|
ret = Indet if match.group(0)[0] == '-' else NaN
|
||||||
else:
|
else:
|
||||||
ret = float(match.group(0))
|
ret = float(match.group(0))
|
||||||
# The following is no longer true as of Server 2022-05-05.571557;
|
# The following is no longer true as of Server 2022-05-05.571557;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue