RATIO_SCALE_LOG
#define RATIO_SCALE (1<<RATIO_SCALE_LOG)
#define RATIO_MAX (0x7fffffff>>RATIO_SCALE_LOG)
new_ratio = db->in_count << RATIO_SCALE_LOG;