Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeetCode第七题Reverse-Integer #266

Open
certram opened this issue Feb 24, 2023 · 2 comments
Open

LeetCode第七题Reverse-Integer #266

certram opened this issue Feb 24, 2023 · 2 comments

Comments

@certram
Copy link

certram commented Feb 24, 2023

题目明确指出不能用64位存储了,leetcode官方给出的代码返回值应该是int32才对。我了解到int类型是根据你的操作系统的位数决定的,而且按照作者您写的代码,if条件判断的时候是已经超出了不要,才返回0。而用int32,根本不能超出,否则会溢出,变随机数了。参考leetcode官方题解。用了math.Min32/10

@haowan1015
Copy link

haowan1015 commented Feb 24, 2023 via email

@xiaokuer
Copy link

xiaokuer commented Feb 24, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants