skg@fluent.co.in wrote:[color=blue]
> Hi,
> I'm writing a c++ code, where in i'm passing a double value to a
> function.
> What i'm sending is a double value in scientific mode
>
> say
> set_value (1234e5.6)[/color]
What is that supposed to mean?
If you mean 1234 * 10 ^ 5.6, you can't write that as a literal;
you will have to use 1234.0 * pow(10.0, 5.6).
If you mean 1234.6 * 10 ^ 5, write 1234.6e5.
[color=blue]
> G++ compiler cribs about invalid suffix .6 to floating constant.
>
> I'm using g++-3.4.2
>
> If i'm doing wrong, then what is the correct way of sending double
> value in scientific mode.[/color]
Any of the following forms:
digit+ '.' digit* [('e' | 'E') [sign] digit+]
digit+ ('e' | 'E') [sign] digit+
'.' digit+ [('e' | 'E') [sign] digit+]
(these are written using EBNF <http://en.wikipedia.org/wiki/EBNF>).
--
Ben Hutchings
Having problems with C++ templates? Your questions may be answered by
<http://womble.decadentplace.org.uk/c++/template-faq.html>.
[ See
http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]