<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
I looked at the SQLLite code and looks like they convert floats to
strings and back. For example in NestedDB.java of SQLLite source its
got:<br><br><br> synchronized int bind_double(long stmt, int pos, double v) throws SQLException {<br> return bind_text(stmt, pos, Double.toString(v)); // TODO<br> }<br><br><br> synchronized double value_double(Function f, int arg) throws SQLException {<br> return Double.parseDouble(value_text(f, arg)); // TODO<br> }<br><br>I might have to do the same.<br><br>> Date: Tue, 19 Mar 2013 23:11:22 +0100<br>> From: fratz@inf.uni-konstanz.de<br>> To: skinhat@hotmail.com<br>> Subject: Re: [Nestedvm] Possible to pass floats in call in NestedVM?<br>> <br>> Hi,<br>> <br>> Thinking about it, it may be possible to do<br>> float foo = *((float *) &integer);<br>> in C to get that float back, but I never tried anything like that.<br>> <br>> However, there is a sqlite java interface (sqlite jdbc) that uses nestedvm,<br>> and that thing definitely has to pass floating point values to C, so it may<br>> be worth having a look at the relevant code.<br>> <br>> regards<br>> Matthias<br>> <br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Mon, 18 Mar 2013 14:19:36 -0700<br>Subject: Re: [Nestedvm] Possible to pass floats in call in NestedVM?<br>From: ehrmann@gmail.com<br>To: skinhat@hotmail.com<br>CC: nestedvm@lists.hcoop.net<br><br>On Mon, Mar 18, 2013 at 1:04 PM, skinhat skinhat <span dir="ltr"><<a href="mailto:skinhat@hotmail.com">skinhat@hotmail.com</a>></span> wrote:<br><div class="ecxgmail_quote"><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">I have tried converting the float into raw int bits:<br>ia[i]=Float.floatToRawIntBits(f);<br><br>in runtime.java but just comes out to a huge integer.<br></div></div></blockquote><div> </div><div> <span style="color:rgb(34,34,34);font-family:arial,sans-serif">That's probably correct. Floats are stored very differently than ints, and the int version of a float will always look nothing like the float. The only exception I can think of is positive zero looking like an int zero. Negative zero looks completely different.</span></div>
</div></div>                                            </div></body>
</html>