What is a concise way to test if floating point value is integral?

Paul Jurczak pauljurczak at yahoo.com
Wed Aug 28 22:47:16 PDT 2013


I'm writing this rather ugly:

sqrt(cast(float)D) != round(sqrt(cast(float)D)

line and I'm looking for more concise notation without 
introducing a meaningless variable to hold expression being 
tested. Is there an equivalent of std.math.trunc(), which would 
return fractional portion instead, maybe frac()?


More information about the Digitalmars-d-learn mailing list