Number and ENumber type

The EGL Number type is a non-instantiable reference type that can refer to any numeric value. In Eclipse IDE for EGL Developers, the type definition for Number is ENumber.

EGL package name

eglx.lang

Example use
Type detail
In the following detail, the Operation annotation indicates that the specified operation is available. For example, use “==” to compare two values, not “$EQ”. Two exceptions are the widen and narrow operations, which are invoked during data conversions; for example, when the as operator is used.
externalType ENumber extends AnyValue type ClassType
   /**
    * {@Operation +} A unary plus (has no effect on the numeric value).
    */
   static function $Plus(value ENumber in) 
          returns (ENumber) {@Operation{"+"}};

   /**
    * {@Operation +} Adds two numbers.
    */
   static function $Plus(lvalue ENumber in, rvalue ENumber in) 
          returns (ENumber) {@Operation{"+"}};

   /**
    * {@Operation -} Negates the value.
    */
   static function $Minus(value ENumber in) 
          returns (ENumber) {@Operation{"-"}};

   /**
    * {@Operation -} Subtracts one number from another.
    */
   static function $Minus(lvalue ENumber in, rvalue ENumber in) 
          returns (ENumber) {@Operation{"-"}};

   /**
    * {@Operation *} Multiplies two numbers.
    */
   static function $Multiply(lvalue ENumber in, rvalue ENumber in) 
          returns (ENumber) {@Operation{"*"}};

   /**
    * {@Operation /} Divides one number by another.
    */
   static function $Divide(lvalue ENumber in, rvalue ENumber in) 
          returns (ENumber) {@Operation{"/"}};

   /**
    * {@Operation %} Computes the remainder of dividing one number by another.
    */
	  static function $Modulo(lvalue ENumber in, rvalue ENumber in)
          returns (ENumber) {@Operation{"%"}};

   /**
    * {@Operation **} Computes lvalue to the power of rvalue.
    */
   static function $PowerOf(lvalue ENumber in, rvalue ENumber in) 
          returns (ENumber) {@Operation{"**"}};

   /**
    * {@Operation <} Compares two numbers.
    */
   static function $LT(lvalue ENumber in, rvalue ENumber in) 
          returns (EBoolean) {@Operation{"<"}};

   /**
    * {@Operation >} Compares two numbers.
    */
   static function $GT(lvalue ENumber in, rvalue ENumber in) 
          returns (EBoolean) {@Operation{">"}};

   /**
    * {@Operation <=} Compares two numbers.
    */
   static function $LTE(lvalue ENumber in, rvalue ENumber in) 
          returns (EBoolean) {@Operation{"<="}};

   /**
    * {@Operation >=} Compares two numbers.
    */
   static function $GTE(lvalue ENumber in, rvalue ENumber in) 
          returns (EBoolean) {@Operation{">="}};

   /**
    * {@Operation ==} Compares two numbers.
    */
   static function $EQ(lvalue ENumber in, rvalue ENumber in) 
          returns(EBoolean) {@Operation{"=="}};

   /**
    * {@Operation !=} Compares two numbers.
    */
   static function $NEQ(lvalue ENumber in, rvalue ENumber in) 
          returns(EBoolean) {@Operation{"!="}};

   /**
    * {@Operation{"widen"} Converts a bigint to a number.
    */
   static function asNumber(value EBigint in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"widen"} Converts a decimal to a number.
    */
   static function asNumber(value EDecimal in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"widen"} Converts a float to a number.
    */
   static function asNumber(value EFloat in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"widen"} Converts an int to a number.
    */
   static function asNumber(value EInt in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"widen"} Converts a smallfloat to a number.
    */
   static function asNumber(value ESmallfloat in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"widen"} Converts a smallint to a number.
    */
   static function asNumber(value ESmallint in) 
          returns(ENumber) {@Operation{"widen"}};

   /**
    * {@Operation{"narrow"} Converts a string to a number.
    */
   static function asNumber(value EString in) 
          returns(ENumber) {@Operation{"narrow"}};
end
Comments
Compatibility
Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.