27 ms·
How does D deal with cases where the computation might be plaform dependent (like floating point arth. or bit kung-fu+ endianess) ? An more generally, what happ
by soulbadguy 9y ago
How does D deal with cases where the computation might be plaform dependent (like floating point arth. or bit kung-fu+ endianess) ? An more generally, what happens when a computation "can" be done at compile time , but "needs" (for correctness or ressource ) done at runtime ?
- WalterBright 9y agoThe same way constant folding is done in any compiler. You try to emulate the math on the target. D is quite specific what computations occur at compile time and what at runtime. It's very much up to the user in how he sets it up.
- Doxin 9y agoD doesn't run code at compile time as an optimisation. It only runs code at compile time in certain constructs like variable declarations or static if statements. If you need your code to run at runtime simply stick it in your code where it needs to run.