Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Complement.cs
1using System;
6
8{
13 {
23 {
24 }
25
31 public override IElement Evaluate(double Operand)
32 {
33 if (Operand != Math.Floor(Operand))
34 throw new ScriptRuntimeException("Operands must be integer values.", this);
35
36 if (Operand < 0)
37 {
38 if (Operand < long.MinValue)
39 throw new ScriptRuntimeException("Operand out of bounds.", this);
40
41 return new DoubleNumber(~(long)Operand);
42 }
43 else
44 {
45 if (Operand > ulong.MaxValue)
46 throw new ScriptRuntimeException("Operand out of bounds.", this);
47
48 return new DoubleNumber(~(ulong)Operand);
49 }
50 }
51 }
52}
Class managing a script expression.
Definition: Expression.cs:39
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Base class for unary double operators.
override IElement Evaluate(double Operand)
Evaluates the double operator.
Definition: Complement.cs:31
Complement(ScriptNode Operand, int Start, int Length, Expression Expression)
Complement operator.
Definition: Complement.cs:21
Basic interface for all types of elements.
Definition: IElement.cs:20