Get the latest tech news
Show HN: val – An arbitrary precision calculator language
An arbitrary precision calculator language. Contribute to terror/val development by creating an account on GitHub.
There is currently ongoing work on a Rust library and web playground, which will provide a few extra ways to interact with the runtime. You may want to save val programs and execute them later, so the command-line interface provides a way to evaluate entire files. CategoryFunction/ConstantDescriptionExample Constants pi Mathematical constant π (≈3.14159) area = pi * r^2e Mathematical constant e (≈2.71828) growth = e^rate Trigonometric sin(x) Sine of x (radians) sin(pi/2)cos(x) Cosine of x (radians) cos(0)tan(x) Tangent of x (radians) tan(pi/4)csc(x) Cosecant of x (radians) csc(pi/6)sec(x) Secant of x (radians) sec(0)cot(x) Cotangent of x (radians) cot(pi/4) Inverse Trig asin(x) Arc sine (-1≤x≤1) asin(0.5)acos(x) Arc cosine (-1≤x≤1) acos(0.5)arc(x) Arc tangent arc(1)acsc(x) Arc cosecant (abs(x)≥1) acsc(2)asec(x) Arc secant (abs(x)≥1) asec(2)acot(x) Arc cotangent acot(1) Hyperbolic sinh(x) Hyperbolic sine sinh(1)cosh(x) Hyperbolic cosine cosh(1)tanh(x) Hyperbolic tangent tanh(1) Logarithmic ln(x) Natural logarithm ln(e)log2(x) Base-2 logarithm log2(8)log10(x) Base-10 logarithm log10(100)e(x) e raised to power x e(2) Numeric sqrt(x) Square root (x≥0) sqrt(16)ceil(x) Round up to integer ceil(4.3)floor(x) Round down to integer floor(4.7)abs(x) Absolute value abs(-5) Collections len(x) Length of list or string len("hello")sum(list) Sum list elements sum([1,2,3]) Conversion int(x) Convert to integer int("42")float(x) Convert to float float("3.14")bool(x) Convert to boolean bool(1)list(x) Convert to list list("abc") I/O print(...) Print without newline print("Hello")println(...) Print with newline println("World")input([prompt]) Read line from stdin name = input("Name: ") String split(str, delim) Split string split("a,b,c", ",")join(list, delim) Join list elements join(["a","b"], "-") Program exit([code]) Exit program exit(1)quit([code]) Alias for exit quit(0) bc(1)- An arbitrary precision calculator language
Or read this on Hacker News