mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rational implemented...trying to figure out exponential
This commit is contained in:
@@ -3598,8 +3598,9 @@ BOOST_AUTO_TEST_CASE(fixed_type_literal_expression)
|
||||
fixed c = 1.0 / 3.0;
|
||||
ufixed d = 599 + .5367;
|
||||
ufixed e = 35.245 % 12.9;
|
||||
ufixed g = 1.2 % 2.00000;
|
||||
//ufixed f = 2.222 ** 3.333;
|
||||
ufixed f = 1.2 % 2.00000;
|
||||
//fixed g = 2 ** -1.5;
|
||||
//fixed h = -3 ** -5.8;
|
||||
}
|
||||
}
|
||||
)";
|
||||
@@ -3631,6 +3632,19 @@ BOOST_AUTO_TEST_CASE(array_declaration_with_fixed_literal)
|
||||
BOOST_CHECK(!success(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(mapping_with_fixed_literal)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
mapping(fixed => string) fixedString;
|
||||
function f() {
|
||||
fixedString[3.14] = "Pi";
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(success(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_array_fixed_literals)
|
||||
{
|
||||
char const* text = R"(
|
||||
@@ -3657,6 +3671,20 @@ BOOST_AUTO_TEST_CASE(size_capabilities_of_fixed_point_types)
|
||||
BOOST_CHECK(success(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(var_capable_of_holding_fixed_constants)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function f() {
|
||||
var a = 0.12345678;
|
||||
var b = 12345678.0;
|
||||
var c = 0.00000009;
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(success(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user