#include "ObjProUsr/trunc.h"
#include "ObjProComGui/cgidbg.h"

void Truncate::parameter_changed()
{
	int accuracy = GetAccuracy();
	if (accuracy > GetRange()) accuracy = GetRange();
	mask = 0x7fffffff ;
    int_over_max = mask ;
    mask >>= (31-accuracy);
    // LogOut << (void *) mask << " A\n" ;
    mask <<= (31-accuracy);
    // LogOut << (void *) mask << " B\n" ;

    mask >>= (31 - GetRange());
    // LogOut << (void *) mask << " C\n" ;

    const double over_max_32 =  0x7fffffff ;
    over_max = over_max_32 ;
    if (over_max > MachWord::max_positive) over_max = MachWord::max_positive ;
    if (over_max > mask) over_max = mask ;
    over_min = -over_max ;
/*
 *	LogOut << "over_max = " << over_max << ", over_min = " << over_min
 *       << "\n" ;
 */


	round_offset = 0 ;
	if (GetRound()) round_offset = .5 * (1 << (GetRange() - accuracy)) ;
}
