fix the bug: dim_t->unsigned long, casting to integer means 64-bit to 32-bit. re-cast back means the first 32-bit is an undeterministic number