跳转到内容

模組:Complex Number/Solver

本页使用了标题或全文手工转换
被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由A2569875留言 | 贡献2022年4月19日 (二) 10:49编辑。这可能和当前版本存在着巨大的差异。

local p = {}
local comp_lib = {}
local cmath = {}
local toCnumber = tonumber
local function load_comp_lib()
	if comp_lib.cmath == nil then 
		comp_lib = require("Module:Complex_Number") 
		cmath = comp_lib.cmath.init
		toCnumber = cmath.constructor
	end
end
function p._trunc(x,n) 
	local _10_n = math.pow(10,n)
	local _10_n_x = _10_n * x
	return (x >= 0)and(math.floor(_10_n_x) / _10_n)or(math.ceil(_10_n_x) / _10_n)
end
function p._numberType(input_num) 
	if type(input_num) == type(0) then
		return "real"
	elseif type(input_num) == type({}) then
		return input_num.numberType or "nan"
	else
		return "nan"
	end
end
function p._isNaN(x)
	return (not (x==x)) and (x~=x)
end
return p