不多见但是实用的部分C函数(2)

一.floor : 把一个小数向下取整 即就是如果数是2.2 ,那向下取整的结果就为2.000000

double floor( double x );

Calculates the floor of a value. 

头文件: <math.h>

二.ceil:功能:把一个小数向上取整(类比floor)

double ceil(doube x)

Calculates the ceiling of a value.

头文件:#include<math.h>

另外 round函数

把浮点数四舍五入

double round(double x)

如:5.3->5

       5.6->6

三.isalpha isupper islower toupper tolower五兄弟

头文件:ctype.h

isalpha()判断是不是字符

isupper()判断是不是大写字母

islower()判断是不是小写字母

toupper()小写字母转大写

tolower()大写字母转小写

四、sqrt pow 二兄弟

头文件:math.h

sqrt : square root 求平方根

double sqrt(double x)   ;

pow:求次方

double pow(double x,double y)  ;

返回x的y次方

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值