optimize() bug?

Posted By: DdlV

optimize() bug? - 05/02/15 23:38

Hi jcl. In Test, this script:

Code:
void	run() {
	set(PARAMETERS);
	int	i = optimize(100,1,500,20);
	int	j = optimize(100,1.500,20);
	printf("\ni,j=%i,%i",i,j);
	quit();
}



produces "i,j=100,20".

The typo in the j optimize call causes the min to be 1.5 and the max to be 20, with no step. Why is 20 returned rather than 100 in Test? The manual seems to say that start may be outside min..max...

Thanks.
Posted By: jcl

Re: optimize() bug? - 05/04/15 10:54

No, I don't think that the start can be outside the valid range.
Posted By: DdlV

Re: optimize() bug? - 05/04/15 14:28

Thanks jcl. OK, then rather than the current ">0" (which is already incorrect given the <0 facility), the manual should say min<=abs(start)<=max?

Thanks.
© 2024 lite-C Forums