Completing C code with D style

kdevel kdevel at vogtner.de
Sat Nov 6 16:11:17 UTC 2021


On Saturday, 6 November 2021 at 13:48:59 UTC, jfondren wrote:
> On Saturday, 6 November 2021 at 13:27:55 UTC, kdevel wrote:
>> On Thursday, 4 November 2021 at 00:53:11 UTC, jfondren wrote:
>>> On Wednesday, 3 November 2021 at 20:36:08 UTC, russhy wrote:
>>>> Keeping things simple helps debugging!

As simple as possible, but not simpler!

[...]

>> What about the number 0 (zero)?
>
> Not treating it as positive is a bug that I introduced in a 
> rewrite.

Mathematically a whole number (integer) is positive iff it is 
greater than 0. Since 0 is not greater than 0 0 is not positive. 
The vocabulary of the program shall be changed such that the term 
"positive" is replaced with "non-negative". Or one introduces one 
(0) or two (-0, +0) new signs ...


More information about the Digitalmars-d-learn mailing list