算术运算导致溢出. [英] arithmetic operation resulted in an overflow.

查看:690
本文介绍了算术运算导致溢出.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public IDataEditState[] Children
{
    get
    {
        if (m_ChildrenCache == null)
        {
            m_ChildrenCache = new IDataEditState[m_Children.Count - 1];
                 
            m_Children.Values.CopyTo(m_ChildrenCache, 0);
        }
        return m_ChildrenCache;
    }
}



在上面的代码中,系统抛出了一个异常,原因是算术运算导致溢出."
m_Children.Count即将为0.

请帮我....



In the above code one exception threw by system as "arithmetic operation resulted in an overflow."
m_Children.Count is coming 0.

please help me out ....

推荐答案

如果m_Children.Count为零,那么您正在尝试使用-1条目创建m_ChildrenCache数组,不会发生...
if m_Children.Count is zero, then you''re trying to create your m_ChildrenCache array with -1 entries, which isn''t going to happen...


这篇关于算术运算导致溢出.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆