Crates.io | rcalc_lib |
lib.rs | rcalc_lib |
version | 1.0.0 |
source | src |
created_at | 2019-04-29 06:33:13.086767 |
updated_at | 2021-07-14 03:10:40.991467 |
description | Mathematical expression calculation library |
homepage | |
repository | https://github.com/VladimirMarkelov/rclc_lib |
max_upload_size | |
id | 130892 |
size | 134,890 |
Mathematical expression evaluation library with big integers, floats, common fractions, and complex numbers support. The library is used by the project RionaCalc
sqrt(-4)
converts float number -4
into complex one -4+0i
and then calculates the result 0+2i
. The same is true for calculating logarithm for negative float numbers, and acos and asin for argument greater than 1.0
(1+2)(2+9)
is calculated as (1+2)*(2+9)
sin cos 2
is calculated as sin(cos(2))
(1+2)*(2+9
is the same as (1+2)*(2+9)
20d30m50s
or 20°30'50"
. Minutes and seconds can be omitted, in this case degrees can be float number like 30.25d
. So, sin(pi/2)
== sin(90°)
_
for readability - it is very useful when using big integers. 3_000.90_23
== 3000.9023
.
and ,
are treated as decimal separators;
. If a function receives more arguments than it requires, the trailing arguments are dropped: e.g, sqrt(11;12;13)
is the same as sqrt(11)
\
to separate its parts. They can be written with integer part or only with numerator and denominator, e.g 1\1\10
== 11\10
1+2i
== 1+i2
. In addition, j
can be used instead of i
- but the calculator outputs always with i
0x
), octal(starts with 0o
), and binary(starts with 0b
) numbers%
can be either a modulo or a percentage operator. It depends on the character position: if %
is right before the expression end or before closing bracket or before another operator and previous operator is one of +
, -
, *
, or /
, the character is considered a percentage operator