www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Re: DMD 1.031 (two missing functions in std.math)

reply David L. Davis <SpottedTiger yahoo.com> writes:
Walter Bright Wrote:

 Some new stuff to make writing templates easier.
 
 http://www.digitalmars.com/d/1.0/changelog.html
 http://ftp.digitalmars.com/dmd.1.031.zip
 
 http://www.digitalmars.com/d/2.0/changelog.html
 http://ftp.digitalmars.com/dmd.2.015.zip
Walter thanks for the updates! In testing my D v1.0 project source code, I found that two functions were removed between v1.028 and the v1.029 releases, the bool isPosZero(real) and bool isNegZero(real) functions that were in std.math. Since D v1.0 shouldn't be changing much, and just mainly bug fixes for the most part, I normally wait a few releases before testing my code against them. Thus looking at std.math I see a lot of nice improvements, but feel the non-private labeled functions should remain in now that D v1.0 as been reached. A two simple wrapper functions should be put back in so existing D v1.0 code doesn't break...in this case of course I could simply add in replacement functions for these in my own code. But the point being that functions should not be removed at this point. I think the following code could replace these two functions using the new changes found in std.math: bool isPosZero(real x) { return isIdentical(x, 0.0); } bool isNegZero(real x) { return isIdentical(x, -0.0); } Thanks, keep up the good work! David L. Davis
Jun 20 2008
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
David L. Davis wrote:
 A two simple wrapper functions should be put back in so existing D
 v1.0 code doesn't break...in this case of course I could simply add
 in replacement functions for these in my own code. But the point
 being that functions should not be removed at this point.
I'll ask Don about it, who has been maintaining std.math.
Jun 20 2008
prev sibling parent reply Don <nospam nospam.com.au> writes:
David L. Davis wrote:
 Walter Bright Wrote:
 
 Some new stuff to make writing templates easier.

 http://www.digitalmars.com/d/1.0/changelog.html
 http://ftp.digitalmars.com/dmd.1.031.zip

 http://www.digitalmars.com/d/2.0/changelog.html
 http://ftp.digitalmars.com/dmd.2.015.zip
Walter thanks for the updates! In testing my D v1.0 project source code, I found that two functions were removed between v1.028 and the v1.029 releases, the bool isPosZero(real) and bool isNegZero(real) functions that were in std.math. Since D v1.0 shouldn't be changing much, and just mainly bug fixes for the most part, I normally wait a few releases before testing my code against them. Thus looking at std.math I see a lot of nice improvements, but feel the non-private labeled functions should remain in now that D v1.0 as been reached. A two simple wrapper functions should be put back in so existing D v1.0 code doesn't break...in this case of course I could simply add in replacement functions for these in my own code. But the point being that functions should not be removed at this point. I think the following code could replace these two functions using the new changes found in std.math: bool isPosZero(real x) { return isIdentical(x, 0.0); } bool isNegZero(real x) { return isIdentical(x, -0.0); } Thanks, keep up the good work! David L. Davis
isPosZero() and isNegZero() were private, and used only for internal unit tests. (If they were exposed, it was a bug). Your code above is correct, though.
Jun 21 2008
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
Don Wrote:

 David L. Davis wrote:
 A two simple wrapper functions should be put back in so existing D v1.0 code
doesn't break...in this case of course I could simply add in replacement
functions for these in my own code. But the point being that functions should
not be removed at this point.
 
 I think the following code could replace these two functions using the new
changes found in std.math:
 
 bool isPosZero(real x)
 { return isIdentical(x, 0.0); }
 
 bool isNegZero(real x)
 { return isIdentical(x, -0.0); }
 
 Thanks, keep up the good work!
 David L. Davis
 
isPosZero() and isNegZero() were private, and used only for internal unit tests. (If they were exposed, it was a bug). Your code above is correct, though.
Hi Don, Got it! Thanks for your reply...I'll add the two now missing/modified functions into my existing code. Leave it to me to find public scoped privates to use in my code. :P But you're right, the comments beside the function names did state that they were used only for unit-tests. So with that thought, they were clearly meant to be privates based on the comments alone. Please keep on the good work on std.math!! David L. Davis
Jun 23 2008
parent Don <nospam nospam.com.au> writes:
David L. Davis wrote:
 Don Wrote:
 
 David L. Davis wrote:
 A two simple wrapper functions should be put back in so existing D v1.0 code
doesn't break...in this case of course I could simply add in replacement
functions for these in my own code. But the point being that functions should
not be removed at this point.

 I think the following code could replace these two functions using the new
changes found in std.math:

 bool isPosZero(real x)
 { return isIdentical(x, 0.0); }

 bool isNegZero(real x)
 { return isIdentical(x, -0.0); }

 Thanks, keep up the good work!
 David L. Davis
isPosZero() and isNegZero() were private, and used only for internal unit tests. (If they were exposed, it was a bug). Your code above is correct, though.
Hi Don, Got it! Thanks for your reply...I'll add the two now missing/modified functions into my existing code. Leave it to me to find public scoped privates to use in my code. :P But you're right, the comments beside the function names did state that they were used only for unit-tests. So with that thought, they were clearly meant to be privates based on the comments alone.
Phew! I'm glad they don't need to be retained, hopefully no-one else was bitten by that bug.
 
    Please keep on the good work on std.math!!
 
 David L. Davis
Jun 23 2008