diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-19 17:28:41 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-19 17:28:41 -0700 |
| commit | c7994cf72043936db1a5023c8475b0b64e0aaa21 (patch) | |
| tree | 0d4082656419e3bb4beccfcd87d8efb90ab28a24 | |
| parent | e42f14dbd174a663d50e710909dc7c172928e7a3 (diff) | |
Added some constants to utils.
| -rw-r--r-- | lib/utils.nom | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/utils.nom b/lib/utils.nom index 54fde72..13c7d49 100644 --- a/lib/utils.nom +++ b/lib/utils.nom @@ -62,6 +62,10 @@ compile [floor %] to: "math.floor(\(% as lua))" compile [round %, % rounded] to: "math.floor(\(% as lua) + .5)" rule [%n rounded to the nearest %rounder] =: =lua "(\(%rounder))*math.floor(\(%n)/\(%rounder) + .5)" +compile [tau] to: "(2*math.pi)" +compile [pi] to: "math.pi" +compile [e] to: "math.e" +compile [golden ratio, phi] to: "((1 + math.sqrt(5)) / 2)" # Common utility functions compile [sum of %items, sum %items] to: "nomsu.utils.sum(\(%items as lua))" |
