I have equation:
2^y = 2^q0 + ... 2^qn
n is a arbitrary integer number(there are arbitrary number of 'q's). the value for 'q's can be as big as 500 which 2^q couldn't store in integer or long variable types. I want to compute 'y' other than the method below, because of storage capacity problem :
log2(2^q0 + ... + 2^qn)
how can i compute 'y' in efficient way in C++. is there anyway to compute 'y' with simple arithmetic operations on 'q's ?!
EDIT: 'q's are non negative, I look for 2 versions of this problem: 'q's are integer, 'q's are double