From 5065a21dec3843532faa54a011551afc927cff22 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 2 Feb 2022 22:10:06 -0500 Subject: =?UTF-8?q?Short=20=E2=80=A2math=20specification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/system.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/spec/system.html') diff --git a/docs/spec/system.html b/docs/spec/system.html index aa3f5ff8..be185367 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -484,6 +484,11 @@

The Unix epoch is 1970-01-01 00:00:00 UTC, and Unix time is the number of seconds since this epoch, with adjustments for leap seconds. •UnixTime is intended for absolute time measurement and should use the source most accurate reflects Unix time when it's called. •MonoTime is intended for relative measurement and should use the method that gives the most precise time differences over the course of the program. Its return value must never decrease between calls.

•_timed returns the total time taken divided by the number of function calls (𝕨 if provided and 1 otherwise), including the overhead required for the outer loop that counts iterations (which will typically be negligible in comparison to the BQN code).

More accurately the modifier •_maxTime_ may fail if execution of 𝔽 takes over 𝕨𝔾𝕩 seconds, and should fail as quickly as it is practically able to. The most likely way to implement this modifier is to interrupt execution at the given time. If 𝔽 completes before the interrupt there is no need to measure the amount of time it actually took.

+

Math

+

System namespace •math contains mathematical utilities that are not easily implemented with basic arithmetic, analogous to C's math.h.

+

Constants ln1010, ln22, log10e÷⋆10, log2e÷⋆2 computed in full precision.

+

Other correctly-rounded arithmetic: monadic Cbrt3, Log22, Log1010, Log1p1+, Expm11-˜; dyadic Hypot+(ט).

+

Standard trigonometric functions Sin, Cos, Tan, Sinh, Cosh, Tanh, with inverses preceded by a (ASin, etc.) and accessable with . Additionally, the dyadic function ATan2 giving the angle of vector 𝕨𝕩 relative to 10. All trig functions measure angles in radians.

Random generation

•MakeRand initializes a deterministic pseudorandom number generator with seed value 𝕩. •rand, if it exists, is a globally accessible generator initialized at first use; this initialization should use randomness from an outside source if available. These random generators aren't required to be cryptographically secure and should always be treated as insecure. A random generator has the following member functions:

-- cgit v1.2.3