Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Smarty divides by 3 incorrectly on a new server

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-23-2005, 10:00 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default 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
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #2  
Old 06-23-2005, 10:29 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default

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
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:15 AM.

   

 
X-Cart forums © 2001-2020