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

曾祥意Calculator任务反馈 #109

Closed
raytaylorlin opened this issue Nov 9, 2015 · 4 comments
Closed

曾祥意Calculator任务反馈 #109

raytaylorlin opened this issue Nov 9, 2015 · 4 comments

Comments

@raytaylorlin
Copy link
Contributor

JS代码思路明确简洁,各种计算器的坑也基本避开了,点赞!此外,“%”是求百分数的意思,并不是求模,不过既然题意没说明,也无所谓。另外请考虑下实际计算值的时候,乘以一个大数最后再除以一个大数是否必要?如果没有了JS对大数字处理的特殊性,例如放在C++中,这种大数运算是否可行?

Bug

  • 按住按钮,鼠标移出按钮,再松开,透明样式没有还原

代码问题

  • 依旧有tab和空格混排的情况,请统一全部使用4空格缩进
  • .num, .cal, .eql, .other这4个类共用的一段CSS,在含义上就表明了它们有一个公有的性质叫“计算器按钮”,所以可以考虑用诸如.cal-button的类来代替,但这4种按钮又分别有其特殊之处,所以确实应该用4个不同的类来表示其特殊的部分。这就是所谓的“泛化”和“特化”
  • 部分JS排版缺少空格
@wszxy
Copy link
Contributor

wszxy commented Nov 9, 2015

关于大数运算的必要性,测试时,0.1 * 0.2会有很长的小数出现,但是大数处理后就OK了。如果放在c++,也是可行的吧,“把需要计算的数字全升级(乘以10的n次幂)成计算机能够精确识别的整数,等计算完毕再降级(除以10的n次幂),这是大部分编程语言处理精度差异的通用方法“。

关于tab和空格,我两次作业都是先在Mac上写,然后在Thinkpad上修改,会不会和这有关?或者是自己粗心?以后会重点注意这个问题

@raytaylorlin
Copy link
Contributor Author

大数问题OK。关于tab和空格,一般sublime配置好应该没问题的吧,保存的时候注意全选一下文件看看有没有混编的情况,下次课我会推荐一个工具来辅助你们提交检查

@raytaylorlin
Copy link
Contributor Author

  • tab和空格混排是解决了,但是采用的是tab缩进,这和你“统一了四空格缩进”的描述不符呀
  • 实例化数组,用数组字面量即可,即var finishedNum = [];,不需要new Array()

@raytaylorlin
Copy link
Contributor Author

任务完成

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

2 participants