Are there any standards on converting integers into floats? For instance, is there a standard for if you have a 64-bit integer value which you need to convert to a float?

a = 50000 * 1000000
b = 2.53432432423
c = a + b

I need the result to be:


I'm just making sure this isn't a "common" situation which there are standard solutions to, or if I have to find my own way..

Posted on 2003-03-08 13:08:01 by coogle
you diden't say where you wanted the convertion to take place

in the source ? (at assembly time)

or in the program ? ( at runtime)
Posted on 2003-03-11 13:19:34 by rob.rice
At runtime .. given an arbitrary 64-bit integer, I need to be able to convert that to a 64-bit float value with as many significant digits as I can (given the size of the original 64-bit integer)...

so... 50000000000 as the 64-bit int, and you want to add 2.53432432423 you'd get


Posted on 2003-03-11 13:30:23 by coogle
Um which? :) I couldn't find an instruction to load a 64-bit integer... a code snippet woudl be appreciated :)

Posted on 2003-03-11 18:48:27 by coogle
this should be the last word on intell assembly

there is a small libc writen in assembly here in the asmutils source code

I checked sorry it dosen't have the convertion you want

the source code for the e3 editor has a 4 function calculator built into it
it is writen in assembly and the same source code can be assembled for
linux ,win9x ,bsd and most other unix (or unix like O/Ss)

this has it some place in it or the calcaulator woulden't work
Posted on 2003-03-11 19:14:07 by rob.rice
Isn't there a fild qword ptr instruction? Opcode DF 2E?
Posted on 2003-03-24 19:58:45 by PopeInnocent
Yep you're right. I imagine that'd be the best solution.
Posted on 2003-03-26 07:01:02 by Eóin