Skip to content

Commit

Permalink
Add golden ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
triallax authored and sharkdp committed May 19, 2022
1 parent bd11b65 commit 572969f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Data/Quantity/Math.purs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module Data.Quantity.Math
, pi
, e
, tau
, phi
) where

import Prelude
Expand Down Expand Up @@ -149,3 +150,6 @@ e = scalar' Decimal.e

tau Quantity
tau = scalar' $ Decimal.fromNumber 2.0 * Decimal.pi

phi Quantity
phi = scalar' $ (one + Decimal.sqrt (Decimal.fromNumber 5.0)) / Decimal.fromNumber 2.0
2 changes: 1 addition & 1 deletion src/Quantities.purs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Data.Quantity (ConversionError(..), Quantity, abs, approximatelyEqual, as
sqrt, toScalar, toScalar', toStandard, (.*), (⊕), (⊖), (⊗), (⊘)) as DQ
import Data.Quantity.Math (acos, acosh, asin, asinh, atan, atan2, atanh, ceil, cos, cosh, e,
exp, factorial, floor, gamma, ln, log10, max, max2, mean, min,
min2, modulo, pi, round, sin, sinh, tan, tanh, tau) as DQM
min2, modulo, pi, round, sin, sinh, tan, tanh, tau, phi) as DQM
import Data.Quantity.Physics (avogadroConstant, electronCharge, electronMass, g0,
gravitationalConstant, kB, planckConstant, protonMass,
idealGasConstant, speedOfLight, µ0, µB, α, ε0, ℏ) as DQP
Expand Down

0 comments on commit 572969f

Please sign in to comment.