# operation between uint256 and 1/100 [duplicate]

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?

• You should actually consider yourself lucky that it throws this error, because this code is really bad regardless of that. The expression `1/100` would be compiled to `0` in 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 7 at 11:19
• In any case, here is an idea for you - it seems that you can simply remove the `/100` on both sides of the expression. – goodvibration Jul 7 at 11:21
• And by the way, what does `contrast take` followed by an `if` statement inside curly braces even mean??? Your question is very poorly-phrased! – goodvibration Jul 7 at 11:22
• @goodvibration I think it would be nice to be polite especially to new contributors. – Lauri Peltonen Jul 7 at 11:25
• @LauriPeltonen: I agree, so I apologize. And I also think that it would be useful not to encourage such low effort in writing a question (encourage by answering such questions) . There are more syntax errors in this question than there are characters, the code is not compilable for several different reasons, and the question in whole doesn't seem to be very contributive (dividing by 100 on both sides???). – goodvibration Jul 7 at 11:29

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`