Inconsistent examples of cutoff code
Posted: Sat Feb 11, 2017 11:38 pm
This has been on my mind for quite sometime and I've been meaning to ask about it in order to finally get a resolution.
Consider the following typical framework...
I've seen example code where instead of saving and returning beta, 'v' is saved and returned.
It must make a difference, me thinks.
Does it have to do with hard vs soft fail?
If so, which is correct for each case?
Consider the following typical framework...
Code: Select all
v = -alphabeta( -beta, -alpha...)
// eventually code gets here...
if ( v >= beta
{
// do cutoff stuff
saveHash(..., beta, ...); // in some examples, v is saved
return beta; // in some examples, v is returned
}
// code continues
It must make a difference, me thinks.
Does it have to do with hard vs soft fail?
If so, which is correct for each case?