C#中Math的使用总结

简介:

1、向上进位取整。Math.Ceiling

    例如: Math.Ceiling(32.6)=33; Math.Ceiling(32.0)=32;

2、向下舍位取整。Math.Floor

    例如: Math.Floor(32.6)=32;

3、取指定位数的小数。Math.Round

    例如:Math.Round(36.236,2)=36.24; Math.Round(36.232,2)=36.23;
4、取指定数字在使用指定底时的对数。Math.Log

    例如:一本16开的书,计算对开了几次。Math.Log(16,2)=4;

分类:  ASP.NET
本文转自左正博客园博客,原文链接:http://www.cnblogs.com/soundcode/p/3296071.html ,如需转载请自行联系原作者
目录
打赏
0
0
0
0
66
分享
相关文章
|
11月前
Math常用方法,什么是math?
Math常用方法,什么是math?
166 0
Math.ceil()
Math.ceil()
187 0
Math.pow()
Math.pow()
99 0
4.2、Math数学对象(floor、random、sqrt、pow、abs)
4.2、Math数学对象(floor、random、sqrt、pow、abs)
220 0
iOS开发-math.h/ceil/floor/round
https://blog.csdn.net/acmicpc123/article/details/50280097
163 0
iOS开发-math.h/ceil/floor/round
Math
机器学习中的数学基础 微分学 求导数 求偏导数 以上两个通过公式或者使用泰勒公式进行逼近得到的 求f(x)在x0处的导数 根据泰勒公式: f(x) = f(x0) + f'(x0)(x - x0) + f''(x0)(x - x0)^2/2! + f'''(x0)(x - x0)^3/3! + .
937 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等