xe(1)
xe(1) โ evaluate expressions ๐
okay bestie, welcome to the xe(1) page from the General Commands Manual. it's giving evaluate expressions and honestly? iconic. โจ
โจ NAME โจ
xe โ evaluate expressions ๐ no cap.
๐ SYNOPSIS ๐
xe [OPTIONS] EXPRESSION [TYPE NAME VALUE]...
๐ธ DESCRIPTION ๐ธ
okay so xe prints the value of EXPRESSION to standard output ๐
that's the main character energy.
EXPRESSION may refer variables defined as a TYPE NAME VALUE triplet. and TYPE may be one of:
cardinal(integral, positive) ๐ฅinteger(integral) โจreal(real) ๐ฆtext(string) ๐ธ
๐ OPTIONS ๐
-P,--printโ Print the parsed expression instead its value. ๐ (yes bestie, instead its value, not the value)-t,--typeโ Print the expression type instead its value. ๐--listโ List functions and exit. โจ--list-1โ List unary operators and exit. ๐--list-2โ List binary operators and exit. ๐ฅ--list-2hโ List binary operators and exit. ๐ (same vibe as--list-2, fr fr)--list-3โ List ternary operators and exit. ๐--list-3hโ List ternary operators and exit. ๐ (again, same as--list-3)--helpโ Print a usage message and exit with a status code indicating success. ๐ซถ--versionโ Print version information on standard output then exit. โญ
๐งฎ SYNTAX ๐งฎ
okay bestie, the expression syntax here is basically giving C expressions energy ๐ โ prefix unary operators, common-syntax binary operators, functions and variables, all chilling together.
And there are exactly four supported types, no more no less:
- cardinal โ integral, positive (yes, only the good vibes side of zero)
- integer โ integral
- real โ real
- text โ string
The available functions are mathematical or text generalities, among which you get all of these:
real Gacos(real x);โ is the in degrees specified arc cosine of xreal Gadiff(real x, real y);โ is the in degrees specified smallest angle between degrees x and degrees y (or something)real Garccos(real x);โ is same asGacos(x)real Garcctg2(real x, real y);โ is the in degrees specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the result (same asGatan2(y, x))real Garcdiff(real x, real y);โ is same asGadiff(x, y)real Garcsin(real x);โ is same asGasin(x)real Garctg(real x);โ is same asGatan(x)real Garctg2(real y, real x);โ is same asGatan2(y, x)real Gasin(real x);โ is the in degrees specified arc sine of xreal Gatan(real x);โ is the in degrees specified arc tangent of xreal Gatan2(real y, real x);โ is the in degrees specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the resultreal Gcos(real x);โ is the cosine of degrees xreal Gparcctg2(real x, real y);โ is the positively defined, in radians specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the result (same asGpatan2(y, x))real Gparctg2(real y, real x);โ is same asGpatan2(y, x)real Gpatan2(real y, real x);โ is the positively defined, in degrees specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the resultreal Gsin(real x);โ is the sine of degrees xreal Gtan(real x);โ is the tangent of degrees xreal Gtg(real x);โ is same asGtan(x)integer abs(integer m);โ is the absolute value of mreal acos(real x);โ is the in radians specified arc cosine of xreal adiff(real x, real y);โ is the in radians specified smallest angle between radians x and radians y (or something)real arccos(real x);โ is same asacos(x)real arcctg2(real x, real y);โ is the in radians specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the result (same asatan2(y, x))real arcdiff(real x, real y);โ is same asadiff(x, y)real arcsin(real x);โ is same asasin(x)real arctg(real x);โ is same asatan(x)real arctg2(real y, real x);โ is same asatan2(y, x)real asin(real x);โ is the in radians specified arc sine of xreal atan(real x);โ is the in radians specified arc tangent of xreal atan2(real y, real x);โ is the in radians specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the resultinteger base2(integer m);โ is the greatest power of 2 less than or equal to m if m is not less than zero, some undefined value otherwiseinteger bcount(integer m);โ is the m bit count (i.e. the number of bits set in m)real ceil(real x);โ is the up rounded value of xcardinal cardinal(cardinal z);โ is zinteger character(text s, integer m);โ is the (positively defined value of the) mth character of s, if such character exists, 0 otherwise (negative position indications are interpreted with respect to the end of string)integer compare(text s, text t);โ is 0 if s is (case sensitive) same as t, less than 0 if s is less than t and greater than 0 if s is greater than treal cos(real x);โ is the cosine of radians xinteger deck2(integer m);โ is the lesser power of 2 greater than or equal to m if m is not less than zero, some undefined value otherwiseinteger drand(integer m);โ is a pseudo-random integer between inclusive 0 and mtext echo(text s);โ is sreal exp(real x);โ is the value of e (the base of natural logarithms) raised to the power of xreal exp2(real x);โ is the value of 2 raised to the power of xreal fabs(real x);โ is the absolute value of xreal fclip(real min, real x, real max);โ is the minimum between max and the maximum between x and mininteger ffs(integer m);โ is the 1 based position of the first (least significant) bit set in m if any, 0 otherwisereal floor(real x);โ is the down rounded value of xinteger fls(integer m);โ is the 1 based position of the last (most significant) bit set in m if any, 0 otherwisereal fmax(real x, real y);โ is the maximum of x and yreal fmin(real x, real y);โ is the minimum of x and yreal fmod(real x, real y);โ is the remainder of dividing x by y, more specifically x - n * y, where n is the quotient of x / y, rounded toward zero to an integerreal fmodf(real x);โ is the same sign as x fractional part of xinteger frame(text s, integer c);โ is the position of the last occurrence of the c non zero character in the s string if any, -1 otherwisereal frand(void);โ is a pseudo-random real between 0 and 1real frexp(real x, integer &e);โ is the (-1; -0.5], [0.5; 1) normalized fraction that multiplied by the power of two to which e is set retrieves xreal fsign(real x);โ is -1 if x is negative, 0 of x is zero, 1 otherwiseinteger gcd(integer m, integer n);โ is the greatest common denominator of m and nreal gclip(real x, real min, real max);โ is the minimum between max and the maximum between x and mininteger iclip(integer min, integer m, integer max);โ is the minimum between max and the maximum between m and minreal imodf(real x);โ is the same sign as x integral part of xinteger integer(integer m);โ is minteger irand(integer m, integer n);โ is a pseudo-random integer between inclusive m and ninteger jclip(integer m, integer min, integer max);โ is the minimum between max and the maximum between m and mininteger kfs(integer m, integer k);โ is the 0 based position of the first kth (least significant) bit set in m if any, the number of bits in m otherwise (kfs(m, 0)is equivalent withxfs(m))integer kls(integer m, integer k);โ is the 0 based position of the last kth (most significant) bit set in m if any, the number of bits in m otherwise (kls(m, 0)is equivalent withxls(m))integer length(text s);โ is the length of sreal limit(real x);โ is the away from zero rounded value of xreal ln(real x);โ is same aslog(x)real log(real x);โ is the natural logarithm of xreal log10(real x);โ is the base 10 logarithm of xreal log2(real x);โ is the base 2 logarithm of xreal lrand(void);โ is a pseudo-random real between -1 and 1integer lz(integer m);โ is the m leading zero bits count, same asxls(m)integer match(text s, text t);โ is 0 if t wild card (case sensitive) matches the s pattern (the*and?literal sign are interpreted as for their shell pattern equivalents), non 0 otherwiseinteger max(integer m, integer n);โ is the maximum of m and ninteger min(integer m, integer n);โ is the minimum of m and nreal modf(real x, real &y);โ is the same sign as x fractional part of x, y is the same sign as x integral part of xreal parcctg2(real x, real y);โ is the positively defined, in radians specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the result (same aspatan2(y, x))real parctg2(real y, real y);โ is same aspatan2(y, x)real patan2(real y, real x);โ is the positively defined, in radians specified arc tangent of y / x, signs of both x and y being used to determine the quadrant of the resultinteger place(text s, integer c);โ is the position of the first occurrence of the c non zero character in the s string if any, -1 otherwisereal pow(real x, real y);โ is the value of x raised to the power of ytext project(text s, integer m);โ is s after position m (negative position indications are interpreted with respect to the end of string)real real(real x);โ is xreal round(real x);โ is the towards nearest integer, half cases away from zero rounded value of xinteger sign(integer m);โ is -1 if m is negative, 0 of m is zero, 1 otherwiseinteger signed(cardinal z);โ is zreal sin(real x);โ is the sine of radians xreal sq(real x);โ is the square of xreal sqrt(real x);โ is the square root of xreal tan(real x);โ is the tangent of radians xreal tg(real x);โ is same astan(x)real track(real x);โ is the towards zero rounded value of xinteger tz(integer m);โ is the m trailing zero bits count, same asxfs(m)cardinal unsigned(integer m);โ is minteger xfs(integer m);โ is the 0 based position of the first (least significant) bit set in m if any, the number of bits in m otherwise (same astz(m))integer xls(integer m);โ is the 0 based position of the last (most significant) bit set in m if any, the number of bits in m otherwise (same aslz(m))
Most of prefix unary and common syntax binary C operators are supported โ including unary !, +, - and ~ and binary *, /, %, +, -, <<, >>, <, >, <=, >=, !=, ==, &, ^, |, &&, ||, =, +=, -=, *=, /=, %=, &=, ^=, |=, <<= and >>= โ and the semantics and precedence are the same or at least very close to those of their C counterparts. iykyk ๐ฅ
๐ AUTHORS ๐
- Ciprian Niculescu
and that's the whole thing bestie, we made it to the end ๐ซถ this one's from the xe(1) manual, the December 2024 edition, and honestly? iconic. no cap. ๐โจ๐
๐ฆ where this page comes from
- epel 10: aime 8.20241231-1.el10_0 ยท GPL-3.0-or-later
- epel 9: aime 8.20241231-1.el9 ยท GPL-3.0-or-later
- fedora 43: aime 8.20241231-1.fc42 ยท GPL-3.0-or-later
- fedora 43: aime 8.20241231-1.fc42 ยท GPL-3.0-or-later
- fedora 43: aime 8.20250217-1.fc43 ยท GPL-3.0-or-later
- fedora 43: aime 8.20250217-1.fc43 ยท GPL-3.0-or-later
- fedora 44: aime 8.20250217-3.fc44 ยท GPL-3.0-or-later
- fedora 44: aime 8.20250217-3.fc44 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms