Ejemplo n.º 1
0
 public override string ToString()
 {
     if (this.IsNull)
     {
         return(System.Data.Common.ADP.NullString);
     }
     OracleConnection.ExecutePermission.Demand();
     return(ToString(TempEnvironment.GetErrorHandle(), this._value));
 }
Ejemplo n.º 2
0
 public static OracleNumber Sign(OracleNumber n)
 {
     if (n.IsNull)
     {
         return(Null);
     }
     OracleConnection.ExecutePermission.Demand();
     return((InternalSign(TempEnvironment.GetErrorHandle(), n._value) > 0) ? One : MinusOne);
 }
Ejemplo n.º 3
0
        public static OracleNumber operator %(OracleNumber x, OracleNumber y)
        {
            if (x.IsNull || y.IsNull)
            {
                return(Null);
            }
            OracleConnection.ExecutePermission.Demand();
            OciErrorHandle errorHandle = TempEnvironment.GetErrorHandle();
            OracleNumber   number      = new OracleNumber(false);

            InternalMod(errorHandle, x._value, y._value, number._value);
            return(number);
        }
Ejemplo n.º 4
0
        public static OracleNumber Truncate(OracleNumber n, int position)
        {
            if (n.IsNull)
            {
                return(Null);
            }
            OracleConnection.ExecutePermission.Demand();
            OciErrorHandle errorHandle = TempEnvironment.GetErrorHandle();
            OracleNumber   number      = new OracleNumber(false);

            InternalTrunc(errorHandle, n._value, position, number._value);
            return(number);
        }
Ejemplo n.º 5
0
        public static OracleNumber Shift(OracleNumber n, int digits)
        {
            if (n.IsNull)
            {
                return(Null);
            }
            OracleConnection.ExecutePermission.Demand();
            OciErrorHandle errorHandle = TempEnvironment.GetErrorHandle();
            OracleNumber   number      = new OracleNumber(false);

            InternalShift(errorHandle, n._value, digits, number._value);
            return(number);
        }
Ejemplo n.º 6
0
        public static OracleNumber Floor(OracleNumber n)
        {
            if (n.IsNull)
            {
                return(Null);
            }
            OracleConnection.ExecutePermission.Demand();
            OciErrorHandle errorHandle = TempEnvironment.GetErrorHandle();
            OracleNumber   number      = new OracleNumber(false);
            int            rc          = System.Data.Common.UnsafeNativeMethods.OCINumberFloor(errorHandle, n._value, number._value);

            if (rc != 0)
            {
                OracleException.Check(errorHandle, rc);
            }
            return(number);
        }
Ejemplo n.º 7
0
        public int CompareTo(object obj)
        {
            if (!(obj.GetType() == typeof(OracleNumber)))
            {
                throw System.Data.Common.ADP.WrongType(obj.GetType(), typeof(OracleNumber));
            }
            OracleNumber number = (OracleNumber)obj;

            if (this.IsNull)
            {
                if (!number.IsNull)
                {
                    return(-1);
                }
                return(0);
            }
            if (number.IsNull)
            {
                return(1);
            }
            OracleConnection.ExecutePermission.Demand();
            return(InternalCmp(TempEnvironment.GetErrorHandle(), this._value, number._value));
        }
Ejemplo n.º 8
0
 internal OracleNumber(string s) : this(false)
 {
     OracleConnection.ExecutePermission.Demand();
     OciErrorHandle errorHandle = TempEnvironment.GetErrorHandle();
     this.FromString(errorHandle, s, this._value);
 }
Ejemplo n.º 9
0
 public OracleNumber(long longValue) : this(false)
 {
     OracleConnection.ExecutePermission.Demand();
     FromInt64(TempEnvironment.GetErrorHandle(), longValue, this._value);
 }
Ejemplo n.º 10
0
 public OracleNumber(double dblValue) : this(false)
 {
     OracleConnection.ExecutePermission.Demand();
     FromDouble(TempEnvironment.GetErrorHandle(), dblValue, this._value);
 }