Module:Math: Difference between revisions

no edit summary
m>Dragons flight
No edit summary
m>Dragons flight
No edit summary
Line 26: Line 26:


     local decimal = string.find( x, '.', 1, true )
     local decimal = string.find( x, '.', 1, true )
     local exponent = string.find( x, 'E', 1, true )
     local exponent_pos = string.find( x, 'E', 1, true )
     local result = 0;
     local result = 0;
      
      
     if exponent ~= nil then
     if exponent_pos ~= nil then
         exponent = string.sub( x, exponent + 1 )
         local exponent = string.sub( x, exponent_pos + 1 )
         x = string.sub( x, 1, exponent - 1 )
         x = string.sub( x, 1, exponent_pos - 1 )
         result = result - tonumber( exponent )
         result = result - tonumber( exponent )
     end     
     end     
Anonymous user