From e79dc41c058a94230ea1c71cb742f7645da756a3 Mon Sep 17 00:00:00 2001 From: Julien Reichardt Date: Wed, 6 Jan 2021 15:53:15 +0100 Subject: [PATCH] Add Math::TAU (#10179) * Add Math::TAU * Add doc comments to Math constants --- src/math/math.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/math/math.cr b/src/math/math.cr index d56de5ce0ac7..49bcd91b353d 100644 --- a/src/math/math.cr +++ b/src/math/math.cr @@ -3,7 +3,11 @@ require "./libm" module Math extend self - PI = 3.14159265358979323846 + # Archimedes' constant (π). + PI = 3.14159265358979323846 + # The full circle constant (τ), equal to 2π. + TAU = 6.283185307179586476925 + # Euler's number (e). E = LibM.exp_f64(1.0) LOG2 = LibM.log_f64(2.0) LOG10 = LibM.log_f64(10.0)