உள்ளடக்கத்துக்குச் செல்

Module:Math

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.
en>Banaticus பயனரால் செய்யப்பட்ட 05:25, 21 பெப்ரவரி 2013 அன்றிருந்தவாரான திருத்தம் (created random module)

Documentation for this module may be created at Module:Math/doc

local mathy = {}

function mathy.random( frame )
    first = tonumber(frame.args[1]) -- if it doesn't exist it's NaN, if not a number it's nil
    second = tonumber(frame.args[2])

    if first then -- if NaN or nil, will skip down to final return
        if first <= second then -- could match if both nil, but already checked that first is a number in last line
            return math.random(first, second)
        end
        return math.random(first)
    end   
    return math.random()
end
"https://ta.wikipedia.org/w/index.php?title=Module:Math&oldid=2828944" இலிருந்து மீள்விக்கப்பட்டது