DMD 1.031 (two missing functions in std.math)

Don nospam at nospam.com.au
Mon Jun 23 08:04:55 PDT 2008


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


More information about the Digitalmars-d-announce mailing list