summaryrefslogtreecommitdiff
path: root/float_test8.bpl
blob: 7e78e2065a89b6902a6f38c0235bc6842a0acfe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Translation from float_double.c
//Should Verify

function {:builtin "(_ to_fp 11 53) RNE"} TO_FLOAT64_FLOAT32(float32) returns (float64);
function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_FLOAT64(float64) returns (float32);
function {:builtin "(_ to_fp 11 53) RNE"} TO_FLOAT64_INT(int) returns (float64);
function {:builtin "(_ to_fp 11 53) RNE"} TO_FLOAT64_REAL(real) returns (float64);

procedure main() returns () {
	var x : float64;
	var y : float32;
	
	x := TO_FLOAT64_REAL(1e20)+TO_FLOAT64_INT(1);
	y := TO_FLOAT32_FLOAT64(x);
	assert x != TO_FLOAT64_FLOAT32(y);
}