...e current amount to share ratio
// 使用当前金额与份额的比率计算份额
share = (amount * totalShares_) / totalAmount;
// Default is to round down (Solidity), round up if required
// 默认是向下舍入 (Solidity),如果需要则向上舍入
if (roundUp && (share ...
...其值。Rust中的变量默认是不可变的,即一旦赋值后,不能更改其值。要使变量可变,必须使用 `mut` 关键字来声明。
让我们来看一个例子:
### 不可变变量(默认)
```rust
fn main() {
let x = 5;
println!("The value of x is: {}",...