contrast take{ if ((address(this).balance)/100>=1/100){ } }
The code above throws type error: incompatible type between uint256 and rational_const 1/100.does anyone know how to solve that?
Solidity doesn't understand fractional numbers and it doesn't support them. In order for it to make the comparison you are doing it would need to store a fractional number at the right hand side and that's not possible.
The obvious solution is to just multiple both side by 100 and therefore it becomes if (address(this).balance >= 1).
Furthermore, as you are comparing Ether balances, keep in mind that 1 as a balance means 1 wei. To be clear you should always write that explicitly so it becomes if (address(this).balance >= 1 wei) Also you have a typo in your code, you should use the keyword contract instead of contrast
1/100would be compiled to0in Solidity, since there are no floating-point types (in fact, even in languages which do support floating-point types, this expression as stated would yield zero, since it uses only integers). – goodvibration Jul 07 '19 at 11:19/100on both sides of the expression. – goodvibration Jul 07 '19 at 11:21contrast takefollowed by anifstatement inside curly braces even mean??? Your question is very poorly-phrased! – goodvibration Jul 07 '19 at 11:22