GcdPolicy
it.grypho.scala.leonardo.core.GcdPolicy
enum GcdPolicy
When a _Rational reduces itself to lowest terms.
The policy changes representation only, never value: 2/6 and 1/3 are the same rational, and _Rational.equals compares by cross-multiplication precisely so that the choice stays invisible to callers. What it does change is cost — gcd is the expensive step of rational arithmetic, while skipping it roughly doubles operand size per operation — which is why it is a measured decision rather than a guess.
Selected per call site rather than through Environment, following the simplifyLogic(e, symmetric, semantics) precedent: nothing in this tier goes through eval yet, so an environment field would be unread. It moves into Environment with the tier-1 AST integration, alongside the working precision.
Attributes
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article