Table of Contents

Enum ExpressionOptions

Namespace
NCalc
Assembly
NCalc.Core.dll

Flag-based options that can be converted to ExpressionConfiguration.

[Flags]
public enum ExpressionOptions

Fields

[Display(Name = "Allow Boolean Calculation")] AllowBooleanCalculation = 512

Allows arithmetic operations with bool values.

Converts to AllowBooleanCalculation.

[Display(Name = "Allow Char Values")] AllowCharValues = 4096

Parses single-quoted one-character values as char.

Converts to AllowCharValues.

[Display(Name = "Allow Null Or Empty Expressions")] AllowNullOrEmptyExpressions = 16384

Allows null or empty expression text to evaluate without throwing.

Converts to AllowNullOrEmptyExpressions.

[Display(Name = "Allow Null Parameter")] AllowNullParameter = 128

Allows the identifier null to resolve to a null value during evaluation.

Converts to AllowNullParameter.

[Display(Name = "Arithmetic Null Or Empty String As Zero")] ArithmeticNullOrEmptyStringAsZero = 131072

Converts null or empty string values to zero during arithmetic operations.

Converts to ArithmeticNullOrEmptyStringAsZero.

[Display(Name = "Case-Insensitive String Comparer")] CaseInsensitiveStringComparer = 32

Gets the string comparer used for string comparisons.

Converts to StringComparer as either CurrentCultureIgnoreCase or OrdinalIgnoreCase, using a case-insensitive string comparer for string comparisons, depending on OrdinalStringComparer.

[Display(Name = "Decimal As Default")] DecimalAsDefault = 64

Converts to Decimal on parser options and FloatingPointNumberType on math options.

[Display(Name = "Ignore Case At Built-In Functions")] IgnoreCaseAtBuiltInFunctions = 2

Enables case-insensitive matching for built-in function names.

Converts to IgnoreCaseAtBuiltInFunctions.

[Display(Name = "Iterate Parameters")] IterateParameters = 8

Treats enumerable parameters as parallel value sequences and returns one result per item.

Converts to IterateParameters.

[Display(Name = "Long As Default")] LongAsDefault = 65536

Converts to Int64 on parser options and IntegerNumberType on math options, unless DecimalAsDefault is also set.

[Display(Name = "No Cache")] NoCache = 4

Enables parsed expression cache usage.

Converts to CacheEnabled set to false, disabling parsed expression cache usage.

[Display(Name = "No String Type Coercion")] NoStringTypeCoercion = 8192

Disables coercion of string values to other types during evaluation.

Converts to NoStringTypeCoercion.

[Display(Name = "None")] None = 0

No options are set.

[Display(Name = "Ordinal String Comparer")] OrdinalStringComparer = 256

Gets the string comparer used for string comparisons.

Converts to StringComparer as either Ordinal or OrdinalIgnoreCase, using ordinal string comparison instead of current-culture comparison, depending on CaseInsensitiveStringComparer.

[Display(Name = "Overflow Protection")] OverflowProtection = 1024

Checks arithmetic binary operations for overflow.

Converts to OverflowProtection.

[Display(Name = "Round Away From Zero")] RoundAwayFromZero = 16

Gets the midpoint rounding strategy.

Converts to MidpointRounding.

[Display(Name = "Strict Type Matching")] StrictTypeMatching = 32768

Makes comparisons between values of different runtime types return false.

Converts to StrictTypeMatching.

[Display(Name = "String Concatenation")] StringConcat = 2048

Concatenates values as strings instead of attempting arithmetic addition.

Converts to StringConcat.

Remarks

Prefer configuring new code with ExpressionConfiguration, LogicalExpressionParserOptions, ExpressionEvaluationOptions, and MathOptions directly. This enum is kept as a compatibility helper for older code paths and is converted by FromOptions(ExpressionOptions).