<big id="a5mua"></big>

      <tt id="a5mua"><dfn id="a5mua"></dfn></tt>
      <wbr id="a5mua"><sup id="a5mua"></sup></wbr>

        
        

      1. 亚洲综合小综合中文字幕,国产久爱免费精品视频,精品国产品香蕉在线,国产午夜精品在人线播放,精品一二三四区在线观看,国产成人无码免费看视频软件 ,色欲久久人妻内射,午夜在线观看成人av
        gzcjx555
        QQ  296686949
        級別: 網絡英雄
        精華主題: 0
        發帖數量: 563 個
        工控威望: 5155 點
        下載積分: 856 分
        在線時間: 447(小時)
        注冊時間: 2014-02-15
        最后登錄: 2025-10-31
        查看gzcjx555的 主題 / 回貼
        樓主  發表于: 2024-03-05 16:35
        請廣大網友幫忙把編程語言給轉換一下
                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) 下載次數:15
        附件: EPSON float與string互轉.txt (2 K) 下載次數:14
        聯系電話15071699246,QQ296686949
        已翻身的咸魚
        級別: 家園常客
        精華主題: 0
        發帖數量: 332 個
        工控威望: 606 點
        下載積分: 202 分
        在線時間: 567(小時)
        注冊時間: 2021-03-04
        最后登錄: 2025-11-01
        查看已翻身的咸魚的 主題 / 回貼
        1樓  發表于: 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()
        {
            // 測試轉換函數
            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;
        }
        本帖最近評分記錄:
      2. 下載積分:+5(gzcjx555)

        主站蜘蛛池模板: 亚洲色成人一区二区三区| 国产精品中文字幕二区| 久久综合偷拍视频五月天| 色爱区综合激情五月激情| 亚洲性夜夜天天天| 麻豆蜜桃AV蜜臀AV色欲AV| 久久精品国产福利一区二区| 成人免费亚洲av在线| 亚洲欧美日韩在线码| 越南毛茸茸的少妇| 亚洲全乱码精品一区二区| 国产精品久久人人做人人爽| 免费大黄网站在线观看| 亚洲色成人一区二区三区| 国产香蕉尹人在线视频你懂的| 日韩有码中文字幕国产| 99精品热在线在线观看视| 九九热精品在线免费视频| 毛片免费观看视频| 国产精品一区二区色综合| 成人午夜视频在线| a级亚洲片精品久久久久久久| 4399理论片午午伦夜理片| 久久国产精品免费一区二区| 免费人成网站免费看视频| 国产乱码精品一区二区三区中文| 国产四虎永久免费观看| 婷婷综合缴情亚洲狠狠| 亚洲精品中文字幕一区二| 美女的胸www又黄的网站| 亚洲最大av一区二区| 国精品无码一区二区三区在线看| 亚洲国产成人无码影片在线播放| 成人av一区二区三区| 亚洲国产精品综合久久20| 国产资源精品中文字幕| 久久天天躁狠狠躁夜夜躁2o2o| 国产精品一在线观看| 一本一本大道香蕉久在线播放| 国产99青青成人A在线| 亚洲av成人在线网站|