# GetLevel() wrong value?

**URL:** <https://openfhe.discourse.group/t/getlevel-wrong-value/544>\
**Category:** Library Questions\
**Created:** [May 12, 2023, 10:03am UTC](https://openfhe.discourse.group/t/getlevel-wrong-value/544 "2023-05-12T10:03:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![narger](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/narger/32/420_2.png) [@narger](https://openfhe.discourse.group/u/narger)\
**Post date:** [May 12, 2023, 10:03am UTC](https://openfhe.discourse.group/t/getlevel-wrong-value/544/1 "2023-05-12T10:03:06Z")

</div>

Hello, I feel like the `c->GetLevel()` function called on a CKKS ciphertext is not exact, or maybe I am missing something. In particular, I create `c`, I square it, and the level stays 0. Is that correct? I leave my [source code here](https://codepaste.xyz/posts/Y896JnSfHGCuzzcghNVJ).

In my source code case the output is:

```auto
Level: 0

Process finished with exit code 0

```

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [May 12, 2023, 3:42pm UTC](https://openfhe.discourse.group/t/getlevel-wrong-value/544/2 "2023-05-12T15:42:57Z")

</div>

For CKKS, the rescaling logic is a bit tricky for `FLEXIBLE*` scaling techniques, especially for the first multiplication. The automated logic aims to reduce the degree of error in approximations. This involves intricate management of ciphertexts at various levels, each with its own scaling factor. OpenFHE tries to shield the user from this intricate process.

If you prefer a more straightforward and predictable behavior, you can use the `FIXEDMANUAL` scaling technique in which you need to manually rescale the ciphertext after every multiplication. Here is an example code:

```auto
c = crypto_context->EvalMult(c, c);
crypto_context->RescaleInPlace(c);

```

More information on the different scaling techniques in OpenFHE can be found in the OpenFHE main paper: [OpenFHE: Open-Source Fully Homomorphic Encryption Library](https://eprint.iacr.org/2022/915.pdf), see Section 2.1.1.
