Skip to content

Commit

Permalink
improve FP precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
y-fujii committed Feb 22, 2018
1 parent 00afe33 commit 5348cdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memol/src/valuegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<'a> Evaluator<'a> {
ast::BinaryOp::Ge => if lhs >= rhs { 1.0 } else { 0.0 },
ast::BinaryOp::Lt => if lhs < rhs { 1.0 } else { 0.0 },
ast::BinaryOp::Gt => if lhs > rhs { 1.0 } else { 0.0 },
ast::BinaryOp::Or => 1.0 - (1.0 - lhs) * (1.0 - rhs),
ast::BinaryOp::Or => lhs + rhs - lhs * rhs,
}
},
Ir::Branch( ref ir_cond, ref ir_then, ref ir_else ) => {
Expand Down

0 comments on commit 5348cdb

Please sign in to comment.