Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
don't set input value if it's NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
cpdt committed Jul 21, 2018
1 parent 28a1fa3 commit 0b91bc7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/compiler/SurfaceMirBuilder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "SurfaceMirBuilder.h"

#include <cmath>

#include "../model/ModelRoot.h"
#include "../model/PoolOperators.h"
#include "../model/objects/ControlSurface.h"
Expand Down Expand Up @@ -192,7 +194,8 @@ void SurfaceMirBuilder::build(MaximCompiler::Transaction *transaction, AxiomMode
assert(numControl);

auto numVal = numControl->value();
if (numVal.left != 0 || numVal.right != 0 || (int) numVal.form != 0) {
if ((numVal.left != 0 || numVal.right != 0 || (int) numVal.form != 0) && !std::isnan(numVal.left) &&
!std::isnan(numVal.right)) {
auto constVal = ConstantValue::num(numVal);
mir.addValueGroup(std::move(vartype), ValueGroupSource::default_val(std::move(constVal)));
continue;
Expand Down

0 comments on commit 0b91bc7

Please sign in to comment.