I understand you cant represent them while writing the code, but are floating-point numbers rounded during the compilation?
Imagine there is an equation in code, that needs some sort of floating-point number, I.e 0.1. Since we can't write this directly, can we divide 10 on 100 to produce 0.1? Will compiler round this down to 0?
P.S I'm well aware of libraries mentioned here https://ethereum.stackexchange.com/a/83786/64937, but in my case, I don't want that much flexibility and complexity, but eventually, if there is no way I will use them.
Best Answer
The compiler does accept decimals in an expression if the resulting value is valid.
For example
uint256 x = 0.23 * 100
is valid. The expressionuint256 y = 0.123 * 100
fails to compile with