Skip to content

Commit 219cd77

Browse files
committed
Make binary float comparison unknown result bounds more precise
1 parent 0492c36 commit 219cd77

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/analyses/base.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ struct
185185
@see C11 7.12.14, 6.5.8, 6.5.9 *)
186186
let fd_binary_pred = function
187187
| Some b -> ID.of_bool IInt b
188-
| None -> ID.top_of IInt (* TODO: [0,1] interval instead? *)
188+
| None -> ID.of_interval IInt (Z.zero, Z.one)
189189

190190
let unop_ID = function
191191
| Neg -> ID.neg

tests/regression/57-floats/01-base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ int main()
2525

2626
__goblint_check((a < 10.) == 1);
2727
__goblint_check((a > 10.) == 0);
28-
__goblint_check((x == 2.) >= 0); // TODO
29-
__goblint_check((x == 2.) <= 1); // TODO
28+
__goblint_check((x == 2.) >= 0);
29+
__goblint_check((x == 2.) <= 1);
3030

3131
__goblint_check(c == 2.f); // SUCCESS
3232
__goblint_check(c < 10.f); // SUCCESS

0 commit comments

Comments
 (0)