Idiomatic D code to avoid or detect devision by zero

Martin Tschierschke mt at smartdolphin.de
Thu Aug 6 08:39:16 UTC 2020


On Monday, 3 August 2020 at 15:33:54 UTC, Dominikus Dittes 
Scherkl wrote:
[...]
> For really long expressions you could also split it on multiple 
> lines:
>
> c = (b_expression == 0)
>   ? (d_longer_expression)
>   : (a_expression/b_expression);
+1 looks clean!



More information about the Digitalmars-d-learn mailing list