Debian Codegraph @

test/regress/cli/regress0/fp/down-cast-RNA.smt2

raw
1 ; COMMAND-LINE: --fp-exp
2 ; EXPECT: unsat
3
4 (set-logic QF_FP)
5 (set-info :source |Written by Andres Noetzli for issue #2183|)
6 (set-info :smt-lib-version 2.6)
7 (set-info :category crafted)
8 (set-info :status unsat)
9
10 (declare-fun r () (_ FloatingPoint 5 9))
11 (define-fun rr () (_ FloatingPoint 5 9) ((_ to_fp 5 9) RNA (fp #b1 #b00000 #b1111111110)))
12
13 ; Let's work out this one out manually
14 ; #b1111111110 is an significand of
15 ; 11111111110, rounding positions (g for guard, s for sticky)
16 ; 123456789gs
17 ; so g = 1, s = 0 which is the tie break case
18 ; RNA says tie break goes away from zero, so this is a round up
19 ; incrementing the significand carries up so the true result should be
20 ; (fp #b1 #b00001 #x00000000)
21
22 (assert (= (fp #b1 #b00000 #xff) rr))
23 (check-sat)