int64_t a = 1234;
double d = (double) a;
Is this the recommended way?
You can also use the conversion syntax, which is equivalent to a static_cast:
int64_t a = 1234;
double d = double(a);
This is a useful syntactic construction in that it allows primitive and class types to be treated the same way in template code, either doing a static_cast, for the primitive, or invoking a constructor, for the class type.