Can I assume Flash and PHP will generate the same floating point numbers?
        Posted  
        
            by Fragsworth
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Fragsworth
        
        
        
        Published on 2010-05-17T18:12:14Z
        Indexed on 
            2010/05/17
            20:20 UTC
        
        
        Read the original article
        Hit count: 261
        
In a multiplayer game I'm developing, we have a few values that are floating point numbers. The back-end (in PHP) and the front-end (in Flash) occasionally perform the same calculations on these numbers, to minimize communication.
I am currently making sure that both sides are using 64-bit doubles, but am I safe to assume that all calculations will be the same?
For instance, what about string to float conversion - should I worry about Flash having a potentially different implementation as PHP? (If this happens, our game will go out of sync - the client will think it is in one state while the server is in another)
With some testing, it appears to be the same, but I'm just not sure. Can someone clarify this for me?
© Stack Overflow or respective owner