Skip to content

Commit

Permalink
Filter Math functions that return NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
Seaforth committed Nov 13, 2016
1 parent a36f6a5 commit 8716ca1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/runtime/providers/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,19 @@ abstract class TotalFunctionConstraint extends Constraint {

// Total functions always have a cardinality of 1
getProposal(tripleIndex, proposed, prefix) {
let proposal = this.proposalObject;
proposal.providing = proposed;
proposal.cardinality = 1;
return proposal;
if(this.returns.length) {
//All except range pass through this function. If isNaN then return.
if (isNaN(this.returns[0])){
console.log("Returning " + this.returns[0]);
return;
}

let proposal = this.proposalObject;
proposal.providing = proposed;
proposal.cardinality = 1;
return proposal;
}
return;
}
}

Expand Down

0 comments on commit 8716ca1

Please sign in to comment.