Expression Reference

July 17, 2026 · View on GitHub

A complete reference for all expression syntax supported by LineSolv.


Basic Arithmetic

Standard PEMDAS (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction) with six operators:

OperatorMeaningExampleResult
+Addition5 + 38
-Subtraction10 - 46
*Multiplication7 * 321
/Division20 / 45
^Exponentiation2 ^ 101024
%Modulo (remainder)17 % 52
×Multiplication (symbol)5×35 \times 315
÷Division (symbol)10 ÷ 25

Operator precedence: ^ > * / % > + -. Use parentheses to override.

InputResultNote
2 + 3 * 414Multiplication first
(2 + 3) * 420Parentheses override
2^3^2512Right-associative: 2^(323^{2})

Natural Language

LineSolv understands conversational English. You can prefix expressions with question words, imperative verbs, or conversational fillers — they are all stripped before evaluation.

Word Numbers

Spell out numbers up to the millions:

InputResult
one plus one2
twenty five plus 328
one hundred100
twenty five hundred25000
twenty five times pi78.5398

Query Prefixes

These leading phrases are ignored:

PrefixExample
what iswhat is 2+2
what doeswhat does 10*5 equal
calculatecalculate 15% of 200
can you calculatecan you calculate 2+2
could you findcould you find 5*3
determinedetermine $2^{1}$0
do you knowdo you know 5+3
figure outfigure out 10 * 5
find the value offind the value of 2 times 3 plus 4
give megive me 3 + 7
show meshow me 5 + 3
tell metell me 10 + 20
work outwork out 2 + 3
would you solvewould you solve 10+5

Conversational Fillers

These leading words/phrases are also stripped:

hello, hey, hi, alright, approximately, about, exactly, i guess, i think, i want, i would like, i'd like, i need to add, let's calculate, lets, like, maybe, now, ok, okay, perhaps, probably, right, roughly, say, so, well, we need, we want, will you compute

Examples:

InputResult
hello how much is 5 + 38
hey there calculate 6 times 742
ok 5+38
well 2+24

Fractions

Fraction Words

InputResult
one half0.5
one third0.3333
two thirds0.6667
one quarter0.25
three quarters0.75

Mixed Numbers

Combine whole numbers and fractions:

InputResult
2 1/22.5
3 3/43.75
2 1/2 + 1.54
3/40.75
3/4 + 1/41

Scale / Multiplicative Words

InputResultMeaning
double 5105 * 2
twice 102010 * 2
triple 393 * 3
half of 201020 / 2
quarter of 10025100 / 4
half a dozen612 / 2
half a couple12 / 2
half a million5000001000000 / 2
half as many as 201020 / 2
half as much as 10050100 / 2
quarter as many as 401040 / 4
quarter as much as 20520 / 4

Power Words

InputResultMeaning
5 squared25525^{2}
3 cubed27333^{3}
cube 327333^{3}
square 525525^{2}
square root of 14412sqrt(144)
cube root of 273cbrt(27)
the square root of 14412sqrt(144)
the cube root of 273cbrt(27)
2 to the power of 38232^{3}
5 exponent 3125535^{3}
5 to the 3125535^{3}

Comparison Phrases

InputResultMeaning
which is bigger 5 or 66max(5, 6)
which is smaller 10 or 88min(10, 8)
which is larger pi or 55max(pi, 5)
10 increased by 51510 + 5
20 decreased by 71320 - 7
5 more than 101510 + 5
3 less than 858 - 3
difference between 10 and 3710 - 3
5 added to 101510 + 5
8 fewer 358 - 3
5 subtract 325 - 3
10 minus 3710 - 3

Division Phrases

InputResultMeaning
10 over 2510 / 2
9 out of 339 / 3
ratio of 10 to 2510 / 2
10 divided by 5210 / 5
3 into 15515 / 3
10 split among 2510 / 2
10 split between 2510 / 2
12 shared among 3412 / 3
12 shared between 3412 / 3

Multiplication Phrases

InputResultMeaning
product of 4 and 3124 * 3
sum of 10 and 51510 + 5
5 lots of 3155 * 3
5 times 4205 * 4
3 times as much as 5153 * 5
3 times more than 5205 + 3*5
2 times as many as 10202 * 10
2 times more than 103010 + 2*10
10 times more than 3333 + 10*3
5 along with 385 + 3
5 combined with 385 + 3
5 together with 385 + 3
5 without 325 - 3

Natural Function Calls

You can call functions using natural language:

InputResult
sine of 00
cosine of 01
tangent of 00
absolute value of -55
the absolute value of -55
natural log of 1004.6052
ln of 1004.6052
log of 1002

Percentage Relationship Questions

InputResult
10 is what percent of 5020%
10 is what % of 5020%
what percent of 50 is 1020%
what percentage of 80 is 2025%
10 as a percentage of 5020%
50% of what is 2550
50 percent of what is 2550
10 out of 50 as a percent20%
10 out of 50 as a percentage20%

Factorial Operator

InputResult
5!120
0!1
3! + 28

Log Base

InputResult
log base 2 of 83
log base 10 of 1002
log base 10 of 100 + 3 squared11

Combinations

InputResult
5 choose 310
10 choose 245
5 choose 2 + 3!16

How Many Times

Asks how many times one number fits into another:

InputResult
how many times does 5 go into 204
how many times does 3 go in 155
how many times does 25 go into 5k200
how many times does 2 go into 1M500000
how many 3 are in 155
how many 5 in 204

Subtraction with "from"

InputResultMeaning
10 from 10090100 - 10
5 from 201520 - 5

Collective Nouns

InputResultValue
a couple22
a dozen1212
a score2020

Combined with scale words:

InputResult
half a dozen6
half a couple1
double a dozen24

Possessive Plurals

Multiply a number by a collective noun value:

InputResultMeaning
3 tens303 * 10
2 hundreds2002 * 100
5 thousands50005 * 1000
2 dozens242 * 12
3 scores603 * 20

Percentages

InputResultMeaning
50%0.5Percentage as decimal
10% of 2002010% * 200
100 + 15%115100 + 15% of 100
200 - 10%180200 - 10% of 200
10% less than 200180200 - 10% of 200
20% more than 100120100 + 20% of 100
100 with 8% tax108100 + 8% of 100
200 after 10% discount180200 - 10% of 200
200 minus 10% discount180200 - 10% of 200
40 plus 15% tip4640 + 15% of 40
how much is one hundred plus fifty percent150100 + 50% of 100
10 per cent of 20020Alternative phrasing
10 pct of 20020Abbreviated phrasing
50 p.c. of 8040Dotted abbreviation

Ordinal Suffixes

Ordinal suffixes are stripped to the base number:

InputResult
1st1
2nd2
3rd3
4th4
1st + 23

SI Notation

Suffixes k (thousand), M (million), and B (billion):

InputResult
5k5000
1.5K1500
3M3000000
2B2000000000
2B / 5k400000

Date Math

InputResult
today + 14 daysDate 14 days from now
today - 7 daysDate 7 days ago
March 1 + 30 daysMarch 31
last monthPrevious month
next weekNext week
2 weeks from nowDate 14 days from now
3 months agoDate 3 months ago

Trailing text after the date expression is ignored:

InputResult
I completing a book at today + 14 days some storyDate 14 days from now

Time / Duration

Use compact time notation with h, m, s suffixes:

InputResult
2h30m9000 (seconds)
2h30m in minutes150 minutes
2h + 1h15m12600 (seconds)

Geometry

InputResult
area of triangle with base 5 and height 1025
volume of cone radius 3 and height 547.1239

Age Calculation

InputResult
born in 2007Age since 2007
born 1990Age since 1990
what is my ageCurrent age
what is my current ageCurrent age
i am 25 years old25
i am twenty five years old25
i am born in 2007 show me my current ageCurrent age
my age is 3030
25 yrs of age25
40 years old40

Purchase Math

LineSolv handles shopping calculations with items, discounts, and tax.

Basic

InputResult
5 items at \$20 each$100.00

With Discount

InputResult
5 items at \$20 each with a 15% discount$85.00

With Discount and Tax

InputResult
5 items at \$20 each with a 15% discount and 8% sales tax$91.80

Natural Language

InputResult
what is the total cost of 5 items at \$20 each with a 15% discount and 8% sales tax added on topCalculation result
I bought 8 items at \$5 each with a 10% discount and 6% sales tax. What's the final price?$40.76
I got 25 hours of freelance work at \$37 per hour. What did I earn?$925.00
That \$200 jacket I've been eyeing is 25% off. What's the sale price?$150.00

Currency Conversion

LineSolv supports 50+ currencies with live exchange rates. Use currency symbols or ISO codes:

Symbol/CodeCurrencySymbol/CodeCurrency
$ / USDUS DollarEUR / euro / eurosEuro
GBP / sterlingBritish PoundJPY / yenJapanese Yen
CNY / yuanChinese YuanINR / rupee / rupeesIndian Rupee
CADCanadian DollarAUDAustralian Dollar
CHFSwiss FrancKRW / wonSouth Korean Won
RUB / ruble / rublesRussian RubleILS / shekel / shekelsIsraeli Shekel
VND / dongVietnamese DongPHP / peso / pesosPhilippine Peso
UAH / hryvniaUkrainian HryvniaKZT / tengeKazakh Tenge
PYG / guaraniParaguayan GuaraniGHS / cediGhanaian Cedi
TRY / liraTurkish LiraAZN / manatAzerbaijani Manat
GEL / lariGeorgian LariBTC / bitcoinBitcoin
THB / bahtThai BahtHKDHong Kong Dollar
SGDSingapore DollarMXNMexican Peso
ZAR / randSouth African RandNZDNew Zealand Dollar
SEK / kronaSwedish KronaNOKNorwegian Krone
PLN / zlotyPolish ZlotyBRLBrazilian Real
BDT / takaBangladeshi TakaPKRPakistani Rupee
LKRSri Lankan RupeeNPRNepalese Rupee
MYR / ringgitMalaysian RinggitIDR / rupiahIndonesian Rupiah
TWD / ntdTaiwan DollarSAR / riyalSaudi Riyal
AED / dirhamUAE DirhamKWD / dinarKuwaiti Dinar
EGPEgyptian PoundNGN / nairaNigerian Naira
COPColombian PesoCLPChilean Peso
ARSArgentine PesoPEN / solPeruvian Sol
MADMoroccan DirhamXAU / goldGold (troy oz)
XAG / silverSilver (troy oz)

Currency examples:

InputResult
$100 + €20$122.80
$20 in euro - 5% discount€18.26
€5$5.70
£20 in usd$26.60
$1.5$1.50

Unit Conversion

Convert between units using in or to:

InputResult
10 inches in cm25.4 cm
1 kg in lb2.205 lb
100 c to f212.0 °F
1 gal in l3.785 l
convert 10 inches to cm25.4 cm
convert 100 km to miles62.14 mi
change 100 c to f212.0 °F

Complete Unit Table

CategoryUnitsAliases
Lengthmm, cm, m, km, in, ft, yd, mimillimeter(s), centimeter(s), meter(s), kilometer(s), inch(es), foot/feet, yard(s), mile(s)
Massg, kg, lb, ozgram(s), kilogram(s), pound(s), ounce(s)
Volumeml, l, gal, qt, cupmilliliter(s), liter(s), gallon(s), quart(s), cups
Temperaturec, fcelsius, fahrenheit
Times, min, h, daysecond(s), minute(s), hour(s), day(s)

Variables

Assign variables and reference them in later expressions:

InputResult
x = 42x = 42
x * 284
y = x + 8y = 50
y / 225
x * pi131.947

Variable names are case-insensitive. You can use any alphanumeric name (no spaces, must start with a letter).


Context References

After evaluating an expression, you can reference the result:

InputResult
4242
of that * 284
then + 1094
result / 247

Special context keywords:

KeywordMeaning
of thatPrevious result
thenPrevious result
resultPrevious result
thatPrevious result
lastPrevious result
last resultPrevious result
previousPrevious result
previous resultPrevious result
priorPrevious result
prior resultPrevious result
last answerPrevious result

Math Functions

All 40+ built-in functions:

CategoryFunctionArgsDescriptionExampleResult
Trigonometrysin(x)1Sine (radians)sin(pi/4)0.7071
cos(x)1Cosine (radians)cos(0)1
tan(x)1Tangent (radians)tan(0)0
asin(x)1Arcsine (radians)asin(1)1.5708
acos(x)1Arccosine (radians)acos(1)0
atan(x)1Arctangent (radians)atan(0)0
atan2(y, x)22-argument arctangentatan2(1, 1)0.7854
Hyperbolicsinh(x)1Hyperbolic sinesinh(0)0
cosh(x)1Hyperbolic cosinecosh(0)1
tanh(x)1Hyperbolic tangenttanh(0)0
Logarithmiclog(x) / ln(x)1Natural logarithmln(100)4.6052
log2(x)1Base-2 logarithmlog2(8)3
log10(x)1Base-10 logarithmlog10(100)2
exp(x)1e^xexp(1)2.7183
Roots & Powersqrt(x)1Square rootsqrt(144)12
cbrt(x)1Cube rootcbrt(27)3
pow(a, b)2a raised to bpow(2, 3)8
Roundinground(x)1Round to nearest integerround(3.7)4
ceil(x)1Round upceil(3.2)4
floor(x)1Round downfloor(3.7)3
trunc(x)1Truncate decimaltrunc(3.7)3
sign(x) / sgn(x)1Sign: -1, 0, or 1sign(-3)-1
Absoluteabs(x)1Absolute valueabs(-5)5
Statisticsavg(n, ...)1+Arithmetic meanavg(1, 2, 3)2
median(n, ...)1+Median valuemedian(1, 2, 3)2
mode(n, ...)1+Most frequent valuemode(1, 1, 2)1
stdev(n, ...) / stddev(n, ...)2+Population standard deviationstdev(10, 20, 30)8.1650
variance(n, ...) / var(n, ...)2+Population variancevariance(10, 20, 30)66.6667
range(n, ...)1+max minus minrange(1, 5, 3)4
Aggregationsum(n, ...)1+Sum of all argumentssum(1, 2, 3)6
min(n, ...)1+Smallest valuemin(1, 2, 3)1
max(n, ...)1+Largest valuemax(1, 2, 3)3
Combinatoricsfact(x) / factorial(x)1Factorial (max 20)fact(5)120
gcd(a, b)2Greatest common divisorgcd(12, 8)4
lcm(a, b)2Least common multiplelcm(4, 6)12
ncr(n, r) / choose(n, r)2Combinations (n choose r)ncr(5, 3)10
Randomrand()0-2Random number (0-1, 0-max, or min-max)rand()0.7234
random(x)0-2Alias for randrandom(10)7.2341
Geometryhypot(a, b) / pythag(a, b) / hypotenuse(a, b)2sqrt(a^2 + b^2)hypot(3, 4)5
Utilityfract(x)1Fractional partfract(3.7)0.7
deg(x)1Radians to degreesdeg(pi)180
rad(x)1Degrees to radiansrad(180)3.1416
Number Theoryisprime(x) / is_prime(x)11 if prime, 0 otherwiseisprime(7)1

Constants

ConstantAliasesValue
piπ3.141592653589793
e2.718281828459045
speed_of_lightlightspeed, c_light299792458
gravityg_force9.80665
planckplanck_constant6.62607015e-34
boltzmannboltzmann_constant1.380649e-23
gas_constantgasconstant8.314462618
avogadroavogadro_constant6.02214076e23
stefan_boltzmannstefanboltzmann5.670367e-8
electron_massme9.10938356e-31
proton_massmp1.67262192369e-27
neutron_massmn1.67492749804e-27
electron_chargee_charge1.602176634e-19
bohr_radiusbohrradius5.29177210903e-11
rydbergrydberg_constant10973731.568160

Combining Patterns

Mix multiple patterns in a single expression:

InputResult
$100 + €20$122.80
2B / 5k400000
a dozen + 3 scores72
how many times does 25 go into 5k200
5 choose 2 + 3!16
log base 10 of 100 + 3 squared11
double a dozen24
3 tens from 5 hundreds470
2h30m in minutes150 minutes
10 inches in cm25.4 cm