2

Of the following three declarations

ufixed constant TEST1 = 256;
uint constant TEST2 = 256;
uint[] testTable1 = [uint(0.001 * TEST1), uint(0.01 * TEST1), uint(1.1 * TEST1)];
uint[] testTable2 = [uint(0.001 * TEST2), uint(0.01 * TEST2), uint(1.1 * TEST2)];
uint[] testTable3 = [uint(0.001 * 256), uint(0.01 * 256), uint(1.1 * 256)];

only testTable3 works.

testTable1 gives the error

UnimplementedFeatureError: Not yet implemented - FixedPointType.

and testTable2 gives one error for each element of type

 TypeError: Operator * not compatible with types rational_const 1 / 1000 and uint256

Is there a way I can define such an array without having to specify the multiplication factor in each element?

solidity ^0.4.24;

0

AFAIK, UnimplementedFeatureError: Not yet implemented - FixedPointType. only support by solidity 0.5.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.