solidity/test/libsolidity/semanticTests/fixedPoint/conversion.sol
Alex Beregszaszi 0fe7d787f3 Add more tests
2021-10-06 13:56:25 +02:00

17 lines
480 B
Solidity

contract C {
function test() public pure returns (uint a, uint b, uint c, uint d) {
fixed64x4 x = -1.1234;
a = uint64(bytes8(x));
fixed64x2 y = fixed64x2(x);
b = uint64(bytes8(y));
fixed16x4 z = fixed16x4(x);
c = uint16(bytes2(z));
ufixed64x4 w = ufixed64x4(x);
d = uint64(bytes8(w));
}
}
// ====
// compileViaYul: also
// ----
// test() -> 0xffffffffffffd41e, 0xffffffffffffff90, 0xd41e, 0xffffffffffffd41e