How to test if a double has no fraction part

2015-09-03 Thread Namal via Digitalmars-d-learn
Hello, is there a modf function like in C++ or something similar which could help me find out if a double has a fractional part or not. Thx

Re: How to test if a double has no fraction part

2015-09-03 Thread rumbu via Digitalmars-d-learn
On Thursday, 3 September 2015 at 10:52:39 UTC, Namal wrote: Hello, is there a modf function like in C++ or something similar which could help me find out if a double has a fractional part or not. Thx http://dlang.org/phobos/std_math.html#.modf

Re: How to test if a double has no fraction part

2015-09-03 Thread Namal via Digitalmars-d-learn
Interesting, in contrary to C++ it saves the integral part in the dummy variable. Doing this I noticed if I try to write a double variable in the console it gives me only the integral part. I only did it with writeln so far. How can I print out a double variable with a precision of 2 for

Re: How to test if a double has no fraction part

2015-09-03 Thread wobbles via Digitalmars-d-learn
On Thursday, 3 September 2015 at 12:51:42 UTC, Namal wrote: Interesting, in contrary to C++ it saves the integral part in the dummy variable. Doing this I noticed if I try to write a double variable in the console it gives me only the integral part. I only did it with writeln so far. How can I