Why is the log2 q value in inf?

uint32_t scaleModSize = 50;
uint32_t firstModSize = 60;
uint32_t ringDim      = 8192;
SecurityLevel sl      = HEStd_NotSet;
BINFHE_PARAMSET slBin = TOY;
uint32_t logQ_ccLWE   = 23;
bool arbFunc          = false;
bool oneHot           = true;  // Change to false if the output should not be one-hot encoded
uint32_t slots          = 4096;  // sparsely-packed
uint32_t batchSize      = slots;
uint32_t numValues      = 4096;
ScalingTechnique scTech = FIXEDMANUAL;
uint32_t multDepth =
        9 + 3 + 1 + static_cast<int>(std::log2(numValues))+5;  // 13 for FHEW to CKKS, log2(numValues) for argmin
if (scTech == FLEXIBLEAUTOEXT)
    multDepth += 1;

CCParams<CryptoContextCKKSRNS> parameters;
parameters.SetMultiplicativeDepth(multDepth);
parameters.SetScalingModSize(scaleModSize);
parameters.SetFirstModSize(firstModSize);
parameters.SetScalingTechnique(scTech);
//parameters.SetSecurityLevel(sl);
parameters.SetSecurityLevel(sl);
parameters.SetRingDim(ringDim);
parameters.SetBatchSize(batchSize);

CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
// enable features that you wish to use
cc->Enable(PKE);
cc->Enable(KEYSWITCH);
cc->Enable(LEVELEDSHE);
cc->Enable(ADVANCEDSHE);
cc->Enable(PRE);
cc->Enable(SCHEMESWITCH);

////////////////////////////////////////////////////////////
// Set-up of parameters
////////////////////////////////////////////////////////////

// Output the generated parameters
std::cout << "p = " << cc->GetCryptoParameters()->GetPlaintextModulus() << std::endl;
std::cout << "n = " << cc->GetCryptoParameters()->GetElementParams()->GetCyclotomicOrder() / 2 << std::endl;
std::cout << "n1 = " << cc->GetCryptoParameters()->GetElementParams()->GetCyclotomicOrder() << std::endl;
std::cout << "log2 q = " << log2(cc->GetCryptoParameters()->GetElementParams()->GetModulus().ConvertToDouble())
          << std::endl;

image

You are trying to run a double computation on a number of 1560 bits, which causes an overflow. For such large numbers you should use GetMSB() instead of the logarithm. For instance, replace log2(cc->GetCryptoParameters()->GetElementParams()->GetModulus().ConvertToDouble()) with cc->GetCryptoParameters()->GetElementParams()->GetModulus().GetMSB(). When you are interested in computing the size of the ciphertext modulus, you can also determine it from the multiplicative depth, the scaling mod size and the first mod size, which are set in the cryptocontext generation. You can also find out more about the individual moduli using code like this openfhe-development/src/pke/examples/advanced-real-numbers.cpp at main · openfheorg/openfhe-development · GitHub.