Re: Inconsistent floating point conversion to bool

2017-12-09 Thread Iain Buclaw via Digitalmars-d
On 9 December 2017 at 12:51, rumbu via Digitalmars-d wrote: > > float f = float.min_normal; > bool fcast1 = cast(bool)f; > bool fcast2 = cast(bool)float.min_normal; > > if (fcast1) > writeln("variable casting to bool is true"); > else > writeln("variable casting

Inconsistent floating point conversion to bool

2017-12-09 Thread rumbu via Digitalmars-d
float f = float.min_normal; bool fcast1 = cast(bool)f; bool fcast2 = cast(bool)float.min_normal; if (fcast1) writeln("variable casting to bool is true"); else writeln("variable casting to bool is false"); if (fcast2) writeln("constant casting to b