in reply to Re: Applying Sign Bit
in thread Applying Sign Bit

When comparing 2 dates the DateCalc(d1,d2) function will return +0:0:WW:HH:MM:SS if the d2 > d1, and -0:0:WW:HH:MM:SS if d1 > d2. I think that is return type 0, and there is another return type that shows Years, Months, Days.

If that return value was +1 or -1 then you can just multiple each item with the "flag" to apply the sign bit. I call it a flag, because it only has 2 states -0 or +0.

Thanks for all the suggestions. I thought I might have overlooked a command that would do this. In the program, I opted to use another method of testings that proved to be more efficient. However, this applying a sign bit bugged me. I just needed to know. :) For future reference and to ease my mind.

Here is another, shouldn't 1 + -0 = -1 ?

budman

Replies are listed 'Best First'.
Re: Re: Re: Applying Sign Bit
by Anonymous Monk on Jan 23, 2004 at 17:38 UTC
    shouldn't 1 + -0 = -1 ?
    No. If you subtracted 1 from each side, you'd have 0 + -0 = -2. That would be bizarre.