假设dis.text = 2,prc.text = 100,我使用的这些codes.It应该是net_prc.text =98,但它给了我-100。有人能告诉我为什么吗?我如何才能获得正确的折扣百分比??
private void net_prcTabChanged(object sender, EventArgs e)
{
int d;
int di;
int i;
d = Convert.ToInt32(dis.Text);
i = Convert.ToInt32(prc.Text);
我在Google云上建立了一个Debian(jessie)虚拟机。我已经安装了所需的依赖项Xfce。现在,我试图用命令'startx‘启动X显示服务器,但是我得到了以下错误
--------
Using system config directory "/usr/share/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
--------
Following messages are present in /var/log/Xorg.0.log
---------------
我对双精度和浮点数的除法的精度和速度有疑问。
例如:
double a;
a=myfun(); //returns a number with lots of decimals
float b=5.0;
double result=a/b;
如果b是双倍,结果会改变吗?如果它们不是双精度的,是否需要更多的时间来计算(因为改变了浮点数的大小以适应双倍尺寸)?