Nicolas Cannasse 13 년 전
부모
커밋
3905dbf593
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      optimizer.ml

+ 2 - 2
optimizer.ml

@@ -557,8 +557,8 @@ let rec reduce_loop ctx e =
 	let e = Type.map_expr (reduce_loop ctx) e in
 	let check_float op f1 f2 =
 		let f = op f1 f2 in
-		let fstr = string_of_float f in
-		if float_of_string fstr = f then { e with eexpr = TConst (TFloat fstr) } else e
+		let fstr = string_of_float f in		
+		if (match classify_float f with FP_nan | FP_infinite -> false | _ -> float_of_string fstr = f) then { e with eexpr = TConst (TFloat fstr) } else e
 	in
 	sanitize_expr (match e.eexpr with
 	| TIf ({ eexpr = TConst (TBool t) },e1,e2) ->