码迷,mamicode.com
首页 >  
搜索关键字:float    ( 12549个结果)
double float的精度问题
三部曲1: #include #include #include using namespace std; int main() { double a=0.0001; float b=0.1; int c=(int)(a*1000)/b; cout #inclu...
分类:其他好文   时间:2014-07-27 11:05:22    阅读次数:180
C++ 结构简介
C++结构体定义struct inflatable{ char name[20]; float volume; double price;}C++创建结构本:inflatable guest={ "Glorious Gloria", 1.88, 29.99};在C中是要加上struc...
分类:编程语言   时间:2014-07-26 14:25:00    阅读次数:238
201403java学习笔记
主函数结构:public class Atm_Demo{public static void main(String[] args){//执行语句;}}java的数据类型:java数据类型分为两种:基础数据类型和引用数据类型。其中基本数据类型包括:(数据型)byte,short,int,float,...
分类:编程语言   时间:2014-07-26 14:14:55    阅读次数:224
Double 与 Float 的值的比较结果
首先看geeksforgeeks上的两个程序: 程序1: #include int main() { float x = 0.1; if (x == 0.1) printf("IF"); else if (x == 0.1f) printf("ELSE IF"); else printf("ELSE"); } 程...
分类:其他好文   时间:2014-07-26 03:03:46    阅读次数:142
android中根据不同分辨率dp和px的相互转算
public class PxAndDp { /** * 根据手机的分辨率从 dp 的单位 转成为 px(像素) */ public static int dip2px(Context context, float dpValue) { final float scale = context.getResources().getDisplayMetrics().density; ...
分类:移动开发   时间:2014-07-26 02:36:36    阅读次数:276
P83
#include main() { float x,amax,amin; scanf("%f",&x); amax=x;amin=x; while(x>=0) { if(x>amax)amax=x; if(x<amin)amin=x; scanf("%f",&x); } printf("\namax=%f\namin=%f\n",amax,amin); }...
分类:其他好文   时间:2014-07-26 02:07:06    阅读次数:179
P89
#include main() { int n,k; float score,sum,ave; for(n=1;n<3;n++) { sum=0.0; for(k=1;k<=4;k++) {scanf("%f",&score); sum+=score; } ave=sum/4.0; printf("NO%d:%f\n",n,ave); } } sum=0.0的位置...
分类:其他好文   时间:2014-07-26 02:04:36    阅读次数:201
libgdx 3D 瞄准星和隐藏鼠标
1. 瞄准星 1 /**画瞄准星*/ 2 private void drawSight(){ 3 debugRenderer.begin(ShapeRenderer.ShapeType.Line); 4 float w = 50; 5 floa...
分类:其他好文   时间:2014-07-26 00:42:36    阅读次数:212
html+css学习笔记 3[浮动]
inline-block/float(浮动) 回顾:inline-block 特性: 1、块在一排显示 2、内联支持宽高 3、默认内容撑开宽度 4、标签之间的换行间隙被解析(问题) 5、ie6 ie7不支持块属性标签的inline-block(问题) float浮动: 1、块在一排显示 ...
分类:Web程序   时间:2014-07-26 00:12:46    阅读次数:383
J2SE基础:8.系统常用类二
1:基础数据与封装类型之间的转型 A:基础数据类型--->封装类型(对象类型) Boolean boolean_1 = new Boolean(true); byte ---->Byte short---->Short char---->Character int--->Integer long-->Long float-->Float double-->Double...
分类:其他好文   时间:2014-07-25 11:24:51    阅读次数:210
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!