For ages we have been writing "x * 0.5f" because it would be faster than division by 2. I've just checked back with what GDC and LDC2 and they generate the same code for "* 0.5" and "/ 2", recognizing that the inverse is lossless, while DMD still uses division for the latter.
This applies to all divisions by powers of two up to a practical limit like the range limit of a ulong 1/2⁶⁴ or the smallest normalized single-precision value 1/2¹²⁶ in case 128-bit cent/ucent are fully implemented.
Comment #1 by robert.schadek — 2024-12-13T18:45:33Z