ceil() bug

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
bossi
Posts: 144
Joined: 30 Jul 2022 11:09
Location: Win11-latest, XYx64 latest, 4K@100%

ceil() bug

Post by bossi »

input : 14.2857142857143 , output : 142857142857143
x32 would return 15 :titter:

vers 27.90.0041

admin
Site Admin
Posts: 66534
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ceil() bug

Post by admin »

Works fine here. :?

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: ceil() bug

Post by highend »

You've used the number in a string?
One of my scripts helped you out? Please donate via Paypal

bossi
Posts: 144
Joined: 30 Jul 2022 11:09
Location: Win11-latest, XYx64 latest, 4K@100%

Re: ceil() bug

Post 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 ...

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: ceil() bug

Post by highend »

It's still a bug and should be fixed (can reproduce it on x64 0041)...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66534
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ceil() bug

Post by admin »

Not here (US regional settings). What is your regional decimal separator?

highend
Posts: 14991
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: ceil() bug

Post by highend »

Mine is a comma (German region, English language) and his example code leads to a wrong result
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66534
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ceil() bug

Post 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:

Post Reply