伊人激情av一区二区三区,亚洲国产精品一区二区制服,国产高潮流白浆喷水免费,老外插女人视频

gzcjx555
QQ  296686949
級別: 工控俠客
精華主題: 0
發(fā)帖數(shù)量: 550 個
工控威望: 4758 點(diǎn)
下載積分: 1164 分
在線時間: 414(小時)
注冊時間: 2014-02-15
最后登錄: 2025-06-17
查看gzcjx555的 主題 / 回貼
樓主  發(fā)表于: 2024-03-05 16:35
請廣大網(wǎng)友幫忙把編程語言給轉(zhuǎn)換一下
        public string float_TO_string(float fl)
        {
            byte[] a = BitConverter.GetBytes(fl);
            return a[0].ToString("X2") + a[1].ToString("X2") + a[2].ToString("X2") + a[3].ToString("X2");
        }
        public string float_TO_string(double dl)
        {
            byte[] a = BitConverter.GetBytes(dl);
            return a[0].ToString("X2") + a[1].ToString("X2") + a[2].ToString("X2") + a[3].ToString("X2")+ a[4].ToString("X2") + a[5].ToString("X2") + a[6].ToString("X2") + a[7].ToString("X2");
        }


        public float string_TO_float(string f1)
        {
            byte[] a = new byte[4];
            a[0] = Convert.ToByte(f1.Substring(0, 2));
            a[1] = Convert.ToByte(f1.Substring(2, 2));
            a[2] = Convert.ToByte(f1.Substring(4, 2));
            a[3] = Convert.ToByte(f1.Substring(6, 2));
            return BitConverter.ToSingle(a, 0);
        }
        public double string_TO_double(string d1)
        {
            byte[] a = new byte[8];
            a[0] = Convert.ToByte(d1.Substring(0, 2));
            a[1] = Convert.ToByte(d1.Substring(2, 2));
            a[2] = Convert.ToByte(d1.Substring(4, 2));
            a[3] = Convert.ToByte(d1.Substring(6, 2));
            a[4] = Convert.ToByte(d1.Substring(8, 2));
            a[5] = Convert.ToByte(d1.Substring(10, 2));
            a[6] = Convert.ToByte(d1.Substring(12, 2));
            a[7] = Convert.ToByte(d1.Substring(14, 2));
            return BitConverter.ToDouble(a, 0);
        }
附件: epson_dll.pdf (1471 K) 下載次數(shù):14
網(wǎng)站提示: 請不要用迅雷下載附件,容易出錯
附件: EPSON float與string互轉(zhuǎn).txt (2 K) 下載次數(shù):13
網(wǎng)站提示: 請不要用迅雷下載附件,容易出錯
聯(lián)系電話15071699246,QQ296686949
已翻身的咸魚
級別: 略有小成
精華主題: 0
發(fā)帖數(shù)量: 301 個
工控威望: 497 點(diǎn)
下載積分: 827 分
在線時間: 515(小時)
注冊時間: 2021-03-04
最后登錄: 2025-06-17
查看已翻身的咸魚的 主題 / 回貼
1樓  發(fā)表于: 2024-03-11 08:52
#include <iostream>
#include <vector>

std::string float_TO_string(float fl)
{
    std::vector<unsigned char> a(sizeof(float));
    memcpy(&a[0], &fl, sizeof(float));

    std::string result;
    for (unsigned char byte : a) {
        char hex[3];
        snprintf(hex, sizeof(hex), "%02X", byte);
        result += hex;
    }

    return result;
}

std::string float_TO_string(double dl)
{
    std::vector<unsigned char> a(sizeof(double));
    memcpy(&a[0], &dl, sizeof(double));

    std::string result;
    for (unsigned char byte : a) {
        char hex[3];
        snprintf(hex, sizeof(hex), "%02X", byte);
        result += hex;
    }

    return result;
}

float string_TO_float(std::string f1)
{
    std::vector<unsigned char> a(4);
    for (int i = 0; i < 4; ++i) {
        a = std::stoul(f1.substr(i * 2, 2), nullptr, 16);
    }

    float fl;
    memcpy(&fl, &a[0], sizeof(float));

    return fl;
}

double string_TO_double(std::string d1)
{
    std::vector<unsigned char> a(8);
    for (int i = 0; i < 8; ++i) {
        a = std::stoul(d1.substr(i * 2, 2), nullptr, 16);
    }

    double dl;
    memcpy(&dl, &a[0], sizeof(double));

    return dl;
}

int main()
{
    // 測試轉(zhuǎn)換函數(shù)
    float f = 3.14f;
    double d = 6.28;

    std::string floatHex = float_TO_string(f);
    std::string doubleHex = float_TO_string(d);

    std::cout << "Float to Hex String: " << floatHex << std::endl;
    std::cout << "Double to Hex String: " << doubleHex << std::endl;

    float convertedFloat = string_TO_float(floatHex);
    double convertedDouble = string_TO_double(doubleHex);

    std::cout << "Hex String to Float: " << convertedFloat << std::endl;
    std::cout << "Hex String to Double: " << convertedDouble << std::endl;

    return 0;
}
本帖最近評分記錄:
  • 下載積分:+5(gzcjx555)

    美女艹鸡巴网站| 亚洲精品综合香蕉久久网| 亚洲色图校园春色欧美日韩| 看黄片一级片黄片一级片| 大黑吊爆操美女| 中年女性逼逼网| 扁桃体肿大有黄色分泌物| 亚洲国产精品爱久久久久| 欧洲色综合天天在线影院| 小泽玛利亚一区二区在线| 鸡鸡痛鸡鸡的黄色骚网站| 国产成人片AⅤ在线观看| 大尺度无码初裸写真福利| 99热国产这里只有精品| 黑屌肏白屄视频| 黑丝美女操逼视频免费看| 交流电三相的相色依次是| 中国av电影一区二区三区| 久久久无码精品国产一区| ……她的骚阴蒂视频……| 麻豆精品久久久久久蜜桃| 69堂成人免费视频精品| 日韩加勒比无码人妻系列| 男生的逼捅进女生的逼里| 国产精品久久久久久月婷| 免费人成在线观看视频不卡| 国内精品成人久久久久久| 久久精品国产精品亚洲综合| 国产在线精品欧美日韩电影| 肏逼流淫水视频| 大黑鸡巴肏小嫩屄的视频| 极品熟女23p| 国产精品久久久久三级通话 | 荡女养成系统h| 欧美大鸡巴插逼| 国产美女福利一区二区三区| 国产激情久久久久99视频| 一级午夜福利视频免费区| 天天啪天天草天天干大香蕉| 男女猛烈无遮挡午夜视频| 色自拍偷拍另类欧洲美女|