Ejemplo n.º 1
0
        public MatrisBase <object> Round(MatrisBase <object> A,
                                         int n = 0)
        {
            if (!A.IsValid())
            {
                throw new Exception(CompilerMessage.MAT_INVALID_SIZE);
            }

            CompilerUtils.AssertMatrixValsAreNumbers(A);

            return(n < 0
                ? throw new Exception(CompilerMessage.ARG_INVALID_VALUE("n", " Sıfırdan büyük olmalı."))
                : A is Dataframe df
                ? new Dataframe(A.Round(n).GetValues(),
                                df.Delimiter,
                                df.NewLine,
                                Dataframe.GetCopyOfLabels(df.GetRowLabels()),
                                Dataframe.GetCopyOfLabels(df.GetColLabels()),
                                df.GetRowSettings().Copy(),
                                df.GetColSettings().Copy())
                : A.Round(n));
        }