log&exp implementations.
fix the truncated bug caused by uint8_t