- Kotlin Standard Library Cookbook
- Samuel Urbanowicz
- 64字
- 2021-07-23 19:05:52
How to do it...
- Let's declare the basic implementation for the function:
fun calculateDisplacement(initialSpeed: Float,
acceleration: Float,
duration: Long): Double =
initialSpeed * duration + 0.5 * acceleration * duration *
duration
- Let's declare a default value for the initialSpeed parameter:
fun calculateDisplacement(initialSpeed: Float = 0f,
acceleration: Float,
duration: Long): Double =
initialSpeed * duration + 0.5 * acceleration * duration *
duration
推薦閱讀
- TensorFlow Lite移動端深度學(xué)習(xí)
- The Android Game Developer's Handbook
- Beginning C++ Game Programming
- Visual Basic 6.0程序設(shè)計計算機(jī)組裝與維修
- C語言程序設(shè)計基礎(chǔ)與實驗指導(dǎo)
- 動手學(xué)數(shù)據(jù)結(jié)構(gòu)與算法
- 21天學(xué)通C++(第5版)
- 零基礎(chǔ)學(xué)C語言第2版
- Android應(yīng)用開發(fā)深入學(xué)習(xí)實錄
- QPanda量子計算編程
- 計算機(jī)應(yīng)用技能實訓(xùn)教程
- Learning Unreal Engine Game Development
- Microsoft Exchange Server 2016 PowerShell Cookbook(Fourth Edition)
- Clojure for Finance
- SCRATCH編程課:我的游戲我做主