Page 1 of 1

ceil() bug

Posted: 06 Sep 2025 20:01
by bossi
input : 14.2857142857143 , output : 142857142857143
x32 would return 15 :titter:

vers 27.90.0041

Re: ceil() bug

Posted: 07 Sep 2025 10:17
by admin
Works fine here. :?

Re: ceil() bug

Posted: 07 Sep 2025 10:49
by highend
You've used the number in a string?

Re: ceil() bug

Posted: 07 Sep 2025 11:31
by bossi

Code: Select all

	$a = 100/7;
	echo $a; // 14.2857142857143
	$b = ceil($a);
	echo $b; // 142857142857143
literally like that , x32 outputs 15 ... same ini on both
but i solve that via

Code: Select all

     gettoken($a  ,  1  ,  "."  ) +1   //  15
so just little inconvenience ...

Re: ceil() bug

Posted: 07 Sep 2025 11:38
by highend
It's still a bug and should be fixed (can reproduce it on x64 0041)...

Re: ceil() bug

Posted: 07 Sep 2025 14:54
by admin
Not here (US regional settings). What is your regional decimal separator?

Re: ceil() bug

Posted: 07 Sep 2025 15:17
by highend
Mine is a comma (German region, English language) and his example code leads to a wrong result

Re: ceil() bug

Posted: 07 Sep 2025 16:58
by admin
Confirmed, this is another TB issue: regionalization is not yet completely implemented. In this case: Scripting fails when processing fractional calculation results if the locale uses a decimal separator other than a dot.

In this case I cannot work around it because apparently the bug only lives in the compiled code.
Ha! I could work around it. Next beta. :party: