When I follow the pattern for Int64ToDouble here, the function always returns 0.0 and the marshalling tests fail. Either I am doing something wrong (likely) or an exception is being thrown every time (seems unlikely).