Zum Inhalt springen

Modul:Math: Unterschied zwischen den Versionen

can't work due to prehandling by #expr, simplify
(problem with lost precision)
(can't work due to prehandling by #expr, simplify)
Zeile 109: Zeile 109:
     local lang = mw.getContentLanguage();
     local lang = mw.getContentLanguage();
      
      
     local value_string = ( frame.args[1] or '0' )
     local value = tonumber( frame.args[1] or 0 );
    local value = tonumber( value_string );
     local precision = tonumber( frame.args[2] or 0 );
     local precision = tonumber( frame.args[2] or 0 );
     local current_precision = z._precision( value );
     local current_precision = z._precision( value );
Zeile 119: Zeile 118:
     -- some circumstances because the terminal digits will be inaccurately reported.
     -- some circumstances because the terminal digits will be inaccurately reported.
     if order + precision >= 14 then
     if order + precision >= 14 then
         local orig_precision = z._precision( value_string );
         precision = 13 - order;      
        if order + orig_precision >= 14 then
            precision = 13 - order;
        end
     end
     end


Anonymer Benutzer