set byte if value cant fit

前端 未结 0 1161
终归单人心
终归单人心 2020-11-30 01:01

I want to set a byte at max or min value, if the value I try to assign is greater. Is there a better way to do it, instead of checking with if statements?

example:

相关标签:
回答
  • 消灭零回复
提交回复
热议问题