How to calculate half, third, fourth?
I'm going to guess something else is wrong in your templates, because all the examples you provided definitely work in Twig. Perhaps you have an error or typo on an earlier line that's preventing your imageHeight calculations from working. I'd also check what imageHeight is set to as that isn't apparent from the snippet you provided; you can check by dumping the value - {{ dump(imageHeight) }}.


Here's a TwigFiddle showing how the math does work: https://twigfiddle.com/522svb
Here are the docs on mathematical operators in Twig: https://twig.symfony.com/doc/2.x/templates.html#math