data type conversion algorithms