Warning: session_start(): open(/var/lib/php/sessions/sess_edvqh06dmvjtuancv5t1smbg1r, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass RegularPriceCells is PriceCells {
// cell size
settable double interval;
// one of the cell limits
settable double base;
double remainder(double price) {
ret mod(price-base, interval);
}
// TODO: not sure if this logic has rounding problems
bool isCellLimit(double price) {
ret remainder(price) == 0;
}
double nextCellLimit(double price) {
double r = remainder(price);
ret price+(1-r)*interval;
}
// next-lower cell limit or NaN if no more cells
double previousCellLimit(double price) {
double r = remainder(price);
ret price-(r == 0 ? 1 : r)*interval;
}
}