4 ms·
This may be a stupid question but: is it actually possible to have a price less than zero? TFA suggests that this line: require(_share_price > 0, “Invalid
by biztos 5y ago
This may be a stupid question but: is it actually possible to have a price less than zero?
TFA suggests that this line:
require(_share_price > 0, “Invalid share price”);
...should be "greater than or equal." But if the share price can't be negative then you'd want to just use an unsigned int and not pay for a require statement, right?
Isn't everyone passing around uint256's these days?
- imtringued 5y agounsigned integers cause more problems than the additional range is worth. If you ever run into negative prices you want them to be negative, not positive in the trillions.