X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Smarty divides by 3 incorrectly on a new server (https://forum.x-cart.com/showthread.php?t=14754)

jds580s 06-23-2005 10:00 AM

Smarty divides by 3 incorrectly on a new server
 
I am changing servers and on the new server smarty is dividing by 3 incorrectly. I know that sounds strange, but I set up a test page in the process of tracking down my the storefront displays incorrectly.

http://160.79.206.160/test.php
and here is the smarty math

you can see that floor(100/4) = 25
but floor(100/3) = 1077979818

http://160.79.206.160/test.tpl
Code:

{math equation="floor(x/y)" x=100 y=$columns assign="cell_width"}


=======================

This is Smarty Results

Cell Width = floor(x/y) x=100 y=columns

columns: {$columns}

Cell Width: {$cell_width}



{math equation="floor(x/y)" x=100 y=3 assign="new_cell_width"}


=======================

Same Smarty math, but with non variable inputs

Cell Width = floor(x/y) x=100 y=3

columns: 3

Cell Width: {$new_cell_width}


{math equation="floor(x/y)" x=100 y=4 assign="new_cell_width"}


=======================

Same Smarty math, but with non variable inputs

Cell Width = floor(x/y) x=100 y=4

columns: 4

Cell Width: {$new_cell_width}




has anyone else seen anything like this before? Any ideas on what I can do? Or am I just crazy, and is this the result it should be giving?

Thanks a bunch!

Justin

jds580s 06-23-2005 10:29 AM

A little more testing (that is shown at the links above) shows that it's not the divide but the floor() function that is causing the error. This is so strange.

Testing floor
floor(1) = 1
floor(1.1) = 1072798105
floor (2) = 2
floor (2.2) = 1073846681
floor (3) = 3
floor (3.3) = 1074423398

Not sure at all where those numbers are coming from

ideas?

Justin


All times are GMT -8. The time now is 11:57 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.