double diff = static_cast<int64_t>(a- b);
a
and b
are of type int64_t
.
I saw this code in our project. I think it is suspicious, but I am really not sure.
I am familiar with static_cast
, and I would not write code like this.
Is this static_cast valid/legit? Is it useful?