<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Well that's...lossy.<br><br>On Mar 19, 2013, at 5:22 PM, skinhat skinhat <<a href="mailto:skinhat@hotmail.com">skinhat@hotmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<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: <a href="mailto:fratz@inf.uni-konstanz.de">fratz@inf.uni-konstanz.de</a><br>> To: <a href="mailto:skinhat@hotmail.com">skinhat@hotmail.com</a><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: <a href="mailto:ehrmann@gmail.com">ehrmann@gmail.com</a><br>To: <a href="mailto:skinhat@hotmail.com">skinhat@hotmail.com</a><br>CC: <a href="mailto:nestedvm@lists.hcoop.net">nestedvm@lists.hcoop.net</a><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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Nestedvm mailing list</span><br><span><a href="mailto:Nestedvm@lists.hcoop.net">Nestedvm@lists.hcoop.net</a></span><br><span><a href="https://lists.hcoop.net/listinfo/nestedvm">https://lists.hcoop.net/listinfo/nestedvm</a></span><br></div></blockquote></body></html>