vendredi 21 octobre 2016

long long to int and int to long long conversion

I wonder if conversion like:

int to long

int to long long

long to int

long long to int

long long to long

long to long long

and

long double to double

double to long double

(and analogously for unsigned) are expensive operations. Should we worry about that conversion and define proper types for assignment? (Of course there is a risk of loss precision but I don't write about it. I'm asking about performance).

For example if I am sure that number can be store in int type. And I have to assign something in function like: void writeToX(long long& x).

Is it important to pass to function long long x instead of int x?

Aucun commentaire:

Enregistrer un commentaire