- iOS Programming Cookbook
- Hossam Ghareeb
- 143字
- 2021-07-09 18:29:43
How it works...
In Double type, we have added two computed properties. The computed properties are properties that will be calculated every time when it's called. We've added a property called absoluteValue, which returns the absolute value; same for intValue, which returns the integer value of double. Then, for any double value in the whole project, these two properties are accessible and can be used.
In the Int type, we have defined three new instance methods. The isEven() method should return true if this number is even, false otherwise, and the same logic applies for isOdd(). The third method that has some more logic is digits(), which returns array of digits in the number. The algorithm is simple; we get the last digit by getting the remainder of piding the number by 10, and then skip the last digit by piding by 10.
- Modern Web Testing with TestCafe
- Linux Mint Essentials
- Kali Linux滲透測試全流程詳解
- 蘋果電腦玩全攻略 OS X 10.8 Mountain Lion
- Learn Helm
- Mastering KVM Virtualization
- Docker+Kubernetes應(yīng)用開發(fā)與快速上云
- Linux使用和管理指南:從云原生到可觀測性
- Linux命令行大全(第2版)
- 云原生落地:產(chǎn)品、架構(gòu)與商業(yè)模式
- Kali Linux高級(jí)滲透測試
- Vim 8文本處理實(shí)戰(zhàn)
- 跟老男孩學(xué)Linux運(yùn)維:Shell編程實(shí)戰(zhàn)
- Heroku Cloud Application Development
- UI設(shè)計(jì)手繪表現(xiàn)從入門到精通