def upgrade_to_float(*types):
 conv = {bool: float32, int8: float32, int16: float32, int32: float64, int64: float64, uint8: float32, uint16: float32, uint32: float64, uint64: float64}
 return (get_scalar_type(Scalar.upcast(*[conv.get(type, type) for type in types])),)

def upgrade_to_float ( * types ) : conv = { bool : float32 , int8 : float32 , int16 : float32 , int32 : float64 , int64 : float64 , uint8 : float32 , uint16 : float32 , uint32 : float64 , uint64 : float64 } return ( get_scalar_type ( Scalar . upcast ( * [ conv . get ( type , type ) for type in types ] ) ) , )
upgrade any int types to float32 or float64 to avoid losing precision .