GreycLab / gmic

GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing
Other
70 stars 12 forks source link

v() bug #63

Open Reptorian1125 opened 6 days ago

Reptorian1125 commented 6 days ago

Just run this code.

foo: v:=v(0,192928249295) echo $v

It just halts or something. I don't see output of $v, and CPU stays at 8%.

Workaround using int(u(0,192928249295)) works though.

dtschump commented 6 days ago

Thanks @Reptorian1125 , very interesting bug. Fixed with https://github.com/GreycLab/CImg/commit/ab7c3a69a901448e92a7c30db07fd83018839da9 Anyway, I had to limit the capabilities of the random integer functions to a 32bits range.

Reptorian1125 commented 5 days ago

Thanks. Does this mean I will have to use int(u()) workaround for larger numbers?

dtschump commented 5 days ago

Thanks. Does this mean I will have to use int(u()) workaround for larger numbers?

OK, I've extended the functions to generate 64bits random integers. Commit : https://github.com/GreycLab/CImg/commit/32ae702c3195ff7d700b8253f79cadeb1ec853c3

But please note technically speaking, larger numbers than +-2^32 cannot be considered as integer anymore (cannot be stored in a 64bits integer). So there are no chances you can get accurate random numbers with larger ranges.