Pi
Pi (Circumference Ratio)
The mathematical constant representing the ratio of a circle's circumference to its diameter, approximately 3.14159.
Detalle técnico
Pi calculations are a source of common errors: a price increase from $100 to $150 is a 50% increase, but returning from $150 to $100 is a 33.3% decrease. Percentage points differ from percentages: an interest rate moving from 2% to 3% is a 1 percentage point increase but a 50% relative increase. In computing, floating-point arithmetic can introduce rounding errors — JavaScript's 0.1 + 0.2 = 0.30000000000000004. Use integer arithmetic (cents, basis points) for financial calculations.
Ejemplo
``` Pi calculation: Input: value = 42 Apply pi: result = f(42) Output: result ```