Idiomatic D code to avoid or detect devision by zero

Dominikus Dittes Scherkl dominikus at scherkl.de
Mon Aug 3 15:33:54 UTC 2020


On Monday, 3 August 2020 at 14:50:36 UTC, Steven Schveighoffer 
wrote:
> On 8/3/20 5:53 AM, Martin Tschierschke wrote:
>> I prefer putting additional bracket around

For really long expressions you could also split it on multiple 
lines:

c = (b_expression == 0)
   ? (d_longer_expression)
   : (a_expression/b_expression);


More information about the Digitalmars-d-learn mailing list