2 ms·
They're quite readable IMO, in the right context (in languages other than PHP) double piecewise(double x) { return x < 0 ? x*x : x <
by cozzyd 4y ago
They're quite readable IMO, in the right context (in languages other than PHP)
double piecewise(double x)
{
return x < 0 ? x*x :
x < 1 ? x :
x < 5 ? x*x-x+1 :
21.
}
- wizofaus 4y agoThat'd be fine if your debugger let you set a breakpoint on the 'x*x-x+1' bit.