打印出C# 中float ,double 在内存中的存放形式
2024-09-04 13:27:14
float floatA = 2.2f;
uint a = BitConverter.ToUInt32(BitConverter.GetBytes(floatA), );
for (int i = ; i < ;++i )
{
uint temp = 0x80000000 & (a << i);
if (temp==)
{
Console.Write("0 ");
}
else
{
Console.Write("1 ");
}
} Console.WriteLine(); double doubleA = 2.2;
ulong b = BitConverter.ToUInt64(BitConverter.GetBytes(doubleA), );
for (int i = ; i < ; ++i)
{
ulong temp = 0x8000000000000000 & (b << i);
if (temp == )
{
Console.Write("0 ");
}
else
{
Console.Write("1 ");
}
}
最新文章
- 【转】NoSQL初探之人人都爱Redis:(2)Redis API与常用数据类型简介
- Fragment 与Activity之间的通信
- Intel+Ardruino 101 翻转时点灯
- Python基础(7)--函数
- NOJ 1643 阶乘除法(YY+小技巧)
- 九度OJ1084
- careercup-树与图 4.5
- SAS软件的使用和统计学分析的初步介绍
- configure: error: Cannot find php-config. Please use --with-php-config=PATH 错误的解决方案
- KICKSTART无人值守安装
- Oracle总结【SQL细节、多表查询、分组查询、分页】
- latex数学公式笔记
- There is no getter for property named &#39;XXX&#39; in &#39;class java.lang.String&#39;解决方法
- loadrunner 事务、同步点和思考时间
- PHP7 学习笔记(十四)Reids 键空间通知配合TP5 实现分布式延时任务
- Linux常用命令行补充——持续更新
- 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第4章编程练习3
- nginx反向代理mysql及负载
- bootstrap modal 弹出其他页面
- 【读书笔记】iOS-网络-使用Bonjour实现自组织网络