负整数文字 [英] negative integer literals

查看:122
本文介绍了负整数文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




是否有可能有负整数字面值或只有正数?


据我所知,下面的代码将是一个正整数

字面值和一元负数运算符。


x = -3.2;


谢谢,

Ivan
http://www.0x4849.net

解决方案

Ivan Novick写道:


你好,


是否有可能有负整数字面值或只有正数?


据我所知,下面的代码是一个正整数

字面值和一元负数运算符。


x = -3.2;


谢谢,

Ivan
http://www.0x4849.net



实际上,它是负*双*字面。

Ivan Novick写道:





是否可能有负整数字面上还是只有正面?


据我所知,下面的代码是一个正整数

字面值和一元负数运算符。


x = -3.2;



原谅我。它根本不是文字。它是一个表达式(未定义

类型,因为你没有定义x)。


-3.2是负双字面值。


red floyd写道:

....


>>



原谅我。它根本不是文字。这是一个表达式(未定义

类型,因为你没有定义x)。


-3.2是负双字面值。



我认为-3.2是双浮点文字。


Hi,

Is it possible to have negative integer literal or only positive?

As far as I understand, the code below would be a positive integer
literal and the unary negative operator.

x = -3.2;

Thanks,
Ivan
http://www.0x4849.net

解决方案

Ivan Novick wrote:

Hi,

Is it possible to have negative integer literal or only positive?

As far as I understand, the code below would be a positive integer
literal and the unary negative operator.

x = -3.2;

Thanks,
Ivan
http://www.0x4849.net

Actually, it''s a negative *double* literal.


Ivan Novick wrote:

Hi,

Is it possible to have negative integer literal or only positive?

As far as I understand, the code below would be a positive integer
literal and the unary negative operator.

x = -3.2;

Pardon me. It''s not a literal at all. It''s an expression (of undefined
type, since you don''t define x).

-3.2 is a negative double literal.


red floyd wrote:
....

>>


Pardon me. It''s not a literal at all. It''s an expression (of undefined
type, since you don''t define x).

-3.2 is a negative double literal.

I thought -3.2 was a double float literal.


这篇关于负整数文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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