---
name: "streval"
section: "3"
platform: "macos"
package: "ksh"
version: "42"
release: "macOS 26.5"
platforms: ["macos"]
url: "https://new.carta.tech/streval"
---

# streval(3)

long integer arithmetic expression evaluator

## NAME

streval - long integer arithmetic expression evaluator

## SYNOPSIS

$1$2long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))long streval(char\* s, char\*\* e, long (\*conv)(char\* cs, char\*\* ce))

## DESCRIPTION

*streval* evaluates the long integer arithmetic expression in the nul-terminated string *s* and returns the result. If *e* is not 0 then *\*e* is set to point to the first unknown character in the expression.

If *conv* is not 0 then it is called when an unknown token is encountered in *s*. *cs* points to the beginning of the unknown token. The return value is the long integer value of the unknown token and *ce* must be set to point to the first character after the unknown token. If an expression syntax error is encountered the *conv* is called with *cs* set to 0 and *\*ce* pointing to the error message text.

In addition to the normal C expressions and integer constant styles, numbers in any base *b* \<= 2 \<=36 may be represented as *b*#*nnnn*, where the extra digits in *nnnn* are taken from **\[A-Z\]**.

## SEE ALSO

[strtol(3)](/strtol/3.md)
