On Nov 28, 2007 8:44 AM, skaller <[EMAIL PROTECTED]> wrote:
> I wanted to test complex (and float) functions, with code like:
>
> println (log 1.2);
>
> for example. The problem here is that the result is system
> dependent. println x calls fprint$ cout, str x, and
> for floats str x calls the C++ helper routine xstr, which uses an
> ostringstream to format x.

There's also the route of writing our own float to string function,
rather than using ostringstream. Then it'd be even more portable since
we could be consistent between different c++ compilers. And, if we
ever write my fabled llvm backend, we wouldn't have to have 2 string
formatters.

> The 'right' solution is to use, for example:
>
>         str_float (x, (width=10, prec=5, fmt=fixed))
>
> [where the second argument is one of those new fangled
> record things ..] Or something similar of course .. :)

I like that :)

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to