DMD 1.031 (two missing functions in std.math)

Don nospam at nospam.com.au
Sat Jun 21 03:05:01 PDT 2008


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.


More information about the Digitalmars-d-announce mailing list