Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private double GET_bounded(double val, double min, double max)
- {
- if (val > max)
- {
- LOG(String.Format(
- "Value out of bounds: bigger then boundary {0} > [max{1}]",
- val, max));
- return max;
- }
- else if (val < min)
- {
- LOG(String.Format(
- "Value out of bounds: lower then boundary {0} < [min{1}]",
- val, min));
- return min;
- }
- else
- {
- return val;
- }
- }
- private byte GET_bounded(byte val, byte min, byte max)
- {
- if (val > max)
- {
- LOG(String.Format(
- "Value out of bounds: bigger then boundary {0} > [max{1}]",
- val, max));
- return max;
- }
- else if (val < min)
- {
- LOG(String.Format(
- "Value out of bounds: lower then boundary {0} < [min{1}]",
- val, min));
- return min;
- }
- else
- {
- return val;
- }
- }
- jo mohl bych si ten string uložit.. ale to je tak všechno.. :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement