|
From: Petr M. <mi...@ph...> - 2004-10-15 16:33:36
|
> back-tics. When called to expand the argument to a particular function, in
> this case system() or execute(), then it *would* expand in backtics.
I though that instead of using
a=`runme`
there would be an alternative with macro expansion:
a=command('runme')
> > >> gnuplot> print sprintf("%i", 5.)
> > >> 0
> > >This example doesn't work in C either.
> >
> > But it works in Octave and awk; I use it there to print an integer part of
> > the value. I would rather prefer an inteligent version that returns in the
> > above example 5.
>
> If Octave does that, I'd say it's a bug, or at least an unreliable behaviour.
> Auto-conversion of an ambiguous variable type is one thing, but
> refusing to do what the user asks for is quite another.
I think that all numbers in Octave are double, so it's not unexpected.
Awk knows how to convert numbers and strings, according to user
"expectation".
The result of the above being "5" is more expected than "0".
---
PM
|