On Aug 12, 2005, at 3:37 PM, Benjamin Holzman wrote:

Hi Ken!

The way it works is that it just calls unpack("U*", $arg) and concatenates the result with '.', then sends it over a socket to the java server (this is
why my original post included the results of unpack).  I'm not sure how
things are reassembled on the java side, but that doesn't really seem to be the problem. After investigating a bit more, I don't think it actually has
anything to do with stringification:

  DB<1> x unpack "U*", 0.056200000000000028
0  48
1  46
2  48
3  53
4  54
5  50

  DB<1> x unpack "U*", 0.056200000000000038
0  48
1  46
2  48
3  53
4  54
5  50

  DB<1> x unpack "U*", 0.056200000000000048
0  48
1  46
2  48
3  53
4  54
5  50

  DB<1> x unpack "U*", 0.056200000000000058
0  48
1  46
2  48
3  53
4  54
5  50
6  48
7  48
8  48
9  48
10  48
11  48
12  48
13  48
14  48
15  48
16  48
17  49

This just shows that you've hit the limit for floating-point accuracy. The first few instances round down to 0.0562, but the final example rounds up to 0.0562000000000001 .

 -Ken

Reply via email to