Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
ChuckOne
on 09/02/2014, 23:01:02 UTC
I am not certain I understand all of this because I haven't got into the source and the algo.

But what is the problem with the source?

Isn't it just a programming error that x-h is negative so it should be fixed upfront?

if you're asking if negative input is legal, yes it is.

To simplify it, it's similar to how modulo operates in C.
If you do:
Code:
int x = (1-3) % 5;    // -2 % 5

you'll get "-2" as a result, but what you're actually interested in is:
Code:
int x = (1-3 + group_order) % 5;    // (-2 + 5) % 5  = 3 % 5 == 5

group_order == 5, and you'll get 3 as a result...

Yes, I know.

So, the problem is that -2 or 3 is processed further and we are not certain if -2 behaves differently than 3 does. That is certainly a problem.

EDIT: we are not certain if the 3 resulting from a -2 is process the same way as we would give it another try.