1. Recently I have made some sqlite3 tasks, defining a blob-type field and saving double-precision floating point numbers here, so something strange happened. The double-precision floating point number is 13.46. The hexadecimal value is 402AEB851EB851EC, but the data in SQLITE is 402ACB851EC2... 1. recently, I have made some sqlite3 tasks. I have defined a blob field and want to store the double-precision floating point number here. This is a strange thing. Double-precision floating point number 13.46. The hexadecimal value is 402A EB85 1EB8 51EC. However, the data in SQLITE is 402A CB85 1EC2 B851 efbf bd. What is this TM? The Code is as follows:
$ Str = $ common-> DoubleToHex (13.46); $ s = hex2bin ($ str); echo $ str; // The output result is 402A EB85 1EB8 51EC, this is correct $ data-> InsertData ("table01", "'ss', '0 ','". $ s. "'", "time, timespan, data"); // Insert the data into sqlite. The data is incorrect.
The strange thing is that errors are generated only when they are double, and other data formats are okay.
Reply content:
1. Recently I have made some sqlite3 tasks, defining a blob-type field and saving double-precision floating point numbers here, so something strange happened. Double-precision floating point number 13.46. The hexadecimal value is 402A EB85 1EB8 51EC. However, the data in SQLITE is 402A CB85 1EC2 B851 efbf bd. What is this TM? The Code is as follows:
$ Str = $ common-> DoubleToHex (13.46); $ s = hex2bin ($ str); echo $ str; // The output result is 402A EB85 1EB8 51EC, this is correct $ data-> InsertData ("table01", "'ss', '0 ','". $ s. "'", "time, timespan, data"); // Insert the data into sqlite. The data is incorrect.
The strange thing is that errors are generated only when they are double, and other data formats are okay.