Home  >  Article  >  Database  >  数学之路-sas备忘(18)

数学之路-sas备忘(18)

WBOY
WBOYOriginal
2016-06-07 16:13:211065browse

data _null_; 本博客所有内容是原创,如果转载请注明来源 http://blog.csdn.net/myhaspl/

data _null_;
x=15.63;
y=15.13;


xx=ceil(x);
yy=ceil(y);
put xx= yy=;


xx=floor(x);
yy=floor(y);
put xx= yy=;


xx=int(x);
yy=int(y);
put xx= yy=;


xx=round(x,0.1);
yy=round(y,0.1);
put xx= yy=;


z=trunc(1/3,3);*按3个字节存储;
put z=;

本博客所有内容是原创,如果转载请注明来源

http://blog.csdn.net/myhaspl/




z=trunc(1/3,6);*按6个字节存储;
put z=;

run;
输出:xx=16 yy=16
xx=15 yy=15
xx=15 yy=15
xx=15.6 yy=15.1
z=0.3333129883
z=0.3333333333
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:HIVE分析函数Next article:16.二叉排序树