go-queue icon indicating copy to clipboard operation
go-queue copied to clipboard

quque range (function minQuantity)

Open shitingbao opened this issue 2 years ago • 1 comments

When the max num value, it will overflow

example:

	var m uint32 = 4294967295
	log.Println(minRoundNumBy2(m))

then, you will get 0

shitingbao avatar May 04 '23 01:05 shitingbao

example,I add some code

	if ^v == 0 {
		v-- // the v type is uint32
	} else {
		v++
	}

shitingbao avatar May 04 '23 02:05 shitingbao