Re: Euphoria equivalent to C typecasting

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matt Lewis wrote:
> 
> This is just a 32-bit floating point number, so you could convert using:
> 
> <font color="#330033"></font>
> <font color="#330033">float = float32_to_atom( </font><font
> color="#FF00FF">peek</font><font color="#993333">( </font><font color="#0000FF">{
> </font><font color="#330033">dataBuffer + bufferIndex, 4</font><font
> color="#0000FF">}</font><font color="#993333">)</font><font
> color="#330033">)</font>
> <font color="#FF0055">-- C writes the output of sprintf to a buffer,
> but</font>
> <font color="#FF0055">-- we just stick it in a sequence in Euphoria:</font>
> <font color="#330033">text  = </font><font color="#FF00FF">sprintf</font><font
> color="#330033">( </font><font color="#00A033">"%0.8e"</font><font
> color="#330033">, float )</font>
> <font color="#330033"></font>
> 
> Matt Lewis
> 
Thanks Matt!  That did the trick.

Jonas

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu