- 24
- 0
- 约1.01万字
- 约 15页
- 2017-10-05 发布于河南
- 举报
四舍六入计算函数公式(Calculate function formula from four to six)
四舍六入计算函数公式(Calculate function formula from four to six)
Four homes five into, odd into my house * *
* * * dlys1019 * *
* date: 2004.11.10 * *
* entrance parameter: * *
* X1: the number of rounds needed * *
* X2: number of digits reserved * * *
FUNCTION ROUNDX
PARA, X1, X2
NAAA=INT (x1*10^ (x2+1))
NBBB=INT (x1*10^x2)
DO case
CASE, VAL (RIGHT (STR (nAAA), 1)) 5,.Or., VAL (RIGHT (STR (nAAA), 1)) 5
RETURN ROUND (x1, x2)
CASE VAL (RIGHT (STR (nAAA), 1)) =5
IF MOD (nBBB, 2) =1
RETURN (nBBB+1) / (10^x2)
ELSE
RETURN nBBB/ (10^x2)
ENDIF
ENDCASE
* for example: round (123.455,2) =123.46 * *
* roundx (123.465,2) =123.46 * *
VB learning --- odd even even function
Measurement procedures must be used to define their own functions, in the measurement of data processing results are required to use odd even even principle to deal with the results. Public, Function, NNN (ByVal, NM, As, Double, ByVal, BB, As, Integer) As Double
Rem * * * odd even input function
Rem * * * NM is a variable that requires a singular entry, and BB is the multiple after the decimal point that the variable needs to retain in the NM. At most 10 decimal places are allowed
Dim BNM As Double
Dim C As Integer
Dim J As Integer
Dim K As Integer
Dim I As Double
C = Sgn (NM) * * sign function
BNM = Abs (NM) * * absolute value function
I = (BNM * 10 ^ (BB + 1) + 10 ^ (-11) - 10 * Fix (BNM * 10 ^ BB + 10 ^ (-11)))
I = (Fix (I * 10 ^ 10)) / 10 ^ 10
J = Fix (BNM * BB ^ 10 + 10 ^ (-11) Fix (BNM) - 10 * * 10 ^ (BB - 1) + 10 ^ (-11)) * * parity
If I 5 Then
K = 1
ElseIf I 5 Then
K = 0
ElseIf (I = 5, And, j = 2 * Fix (J / 2)) Then
K = 0
Else
K = 1
End If
NNN = C * Fix (BNM * 10 ^ BB + k) / 10 ^ BB
End Function
For reference.....
Abstract: Excel is very familiar with the application software, and its use is very convenient. Especially its powerful functions, has brought great convenience for us, but sometimes we to achieve a specified function, may use several functions or the use of nested functions, such application, is not
您可能关注的文档
- 十佳少年3000字(Top ten juvenile 3000 words).doc
- 十二条毛主席语录对营销的启发(Twelve quotations from Chairman Mao's inspiration for marketing).doc
- 医疗营销站优化方案(Optimization scheme of medical marketing Station).doc
- 十八届四中全会精神解读(Spiritual interpretation of the fourth Plenary Session of the 18th CPC Central Committee).doc
- 十大名鞋(Ten name shoes).doc
- 十八岁的天空 经典语句(Eighteen year old sky classics).doc
- 十大小提琴演奏家(Ten big violinist).doc
- 十大宰人旅游景点(Ten major tourist attractions).doc
- 十大感动中国人物2012(Ten big moving Chinese characters 2012).doc
- 十大热点专业(Ten hot major).doc
- 回帖灌水技巧(Card irrigation skills).doc
- 回报社会 传递爱心(Return society, pass love).doc
- 回答(Answer).doc
- 回顾总结我的6年网络生涯时间(Review and summarize my 6 years online career time).doc
- 回顾2005年展望2006冷饮行业分析(Review 2005 outlook 2006 cold drinks industry analysis).doc
- 团支部资料(League branch information).doc
- 因数与倍数(Factor and multiple).doc
- 团课笔记(Class notes).doc
- 团购网盈利模式(Net profit model).doc
- 团购网站信用认证遭拒(Group purchase website refused credit certification).doc
最近下载
- 【解题模型】碰撞模型-2026高考物理(解析版).pdf VIP
- 2022年《Java程序设计项目化教程》.pdf VIP
- 先进成形与智能技术 课件 第10章 数字孪生技术.pptx
- 施工人员进场前安全培训教育资料.pdf VIP
- Q_0303SXH311-2019洁净蒸汽灭菌器.pdf
- SY∕T 5396-2012_石油套管现场检验、运输与贮存.pdf VIP
- (2025年)人教版七年级上册英语单词表(可直接打印).pdf VIP
- 【精品】五升六英语测试题.pdf VIP
- 输变电工程建设标准强制性条文实施管理规程第部分变电站电气工程设计.docx VIP
- 卫生部手术分级目录(2025年1月份修订).doc VIP
原创力文档

文档评论(0)