Rational

The Rational type allows you to perform all decimal arithmetic:

operationoperand
addciphertext, plaintext, literal
subciphertext, plaintext, literal
mulciphertext, plaintext, literal
divciphertext, plaintext, literal

Additionally, you can perform unary negation on Rational ciphertexts (i.e., given a, compute -a).

Representation

Rational encodes a numerator and denominator as two independent Signed values. This results in ciphertexts twice as large as when using the Fractional type.

Efficiency

In addition to the increased size, each Rational operation (except negation) requires multiple FHE operations. Thus, even addition can quickly increase FHE program complexity. Using Rational ciphertexts in prolonged computation may require larger scheme parameters (hence resulting in slower computations).