1 Star 0 Fork 3

m-RNA / WFloat

forked from Morphlng / WFloat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
type_conversion.cpp 750 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include "WFloat.hpp"
#include <iostream>
using namespace std;
void TypeConversion(const WFloat &num)
{
cout << "num = " << num << endl;
cout << "num.toString = " << num.toString() << endl;
cout << "num.toFloat = " << num.toFloat() << endl;
cout << "num.toDouble = " << num.toDouble() << endl;
cout << "num.toLongDouble = " << num.toLongDouble() << endl;
cout << "num.toInt = " << num.toInt() << endl;
cout << "num.toLong = " << num.toLong() << endl;
cout << "num.toLongLong = " << num.toLongLong() << endl;
}
int main()
{
WFloat num{0};
for (;;)
{
cout << "input num = ";
cin >> num;
TypeConversion(num);
cout << endl;
}
}
C++
1
https://gitee.com/chenjjian/wfloat.git
git@gitee.com:chenjjian/wfloat.git
chenjjian
wfloat
WFloat
master

搜索帮助