1. error in value()?
Look at these value()-returns:
--
include get.e
--
? value("1a")
? value("2b")
? value("3c")
? value("4d")
? value("5e")
? value("6f")
? value("1A")
? value("2B")
? value("3C")
? value("4D")
? value("5E")
? value("6F")
puts(1,"\nI guess, the value of \"5e\" and \"5E\" should be both
{0,5}!\n")
Any remarks? Rolf
2. Re: error in value()?
> Look at these value()-returns:
<snip>
> puts(1,"\nI guess, the value of \"5e\" and \"5E\" should be
> both{0,5}!\n")
>
> Any remarks? Rolf
My guess is that value sees the 'e' after the five and expects another
number (the 10's exponent) to follow...
5e2 is like 5 x 10^2 = 5 x 100 = 500
_______ ______ _______ ______
[ _ \[ _ ][ _ _ ][ _ ]
[/| [_] |[/| [_\][/ | | \][/| [_\]
| ___/ | _] | | | _]
[\| [/] [\| [_/] [\| |/] [\| [_/]
[_____] [______] [_____] [______]
xseal at harborside.com ICQ:13466657
http://www.harborside.com/home/x/xseal/euphoria/
3. Re: error in value()?
Lewis Townsend wrote:
...
>
> Yes, here's what my computer output:
>
> {0,1}
> {0,2}
> {0,3}
> {0,4}
> {1,0}
> {0,6}
> {0,1}
> {0,2}
> {0,3}
> {0,4}
> {1,0}
> {0,6}
>
> I guess, the value of "5e" and "5E" should be both {0,5}!
...
I think value() translates each string into a number as long as there
is no letter from the beginning of the string. However, in case it
finds an 'E' or 'e' it has to account for the possibility it could be
an number written with the exponential format. In my opinion it should
check in such cases for numbers (with possible sign) after the 'E' or 'e'.
Even better might be to return in all cases like "1a" with {1,0}!
...
> I'm sure some of our gurus can explain it.
I hope so...
By the way, Lewis, you send your mail to my privat address , not to
EUPHORIA at LISTSERV.MUOHIO.EDU .
Have a nice day, Rolf
4. Re: error in value()?
Rolf Schroeder wrote:
> include get.e
> ? value("1a")
> ? value("2b")
> ? value("3c")
> ? value("4d")
> ? value("5e")
> ? value("6f")
> ? value("1A")
> ? value("2B")
> ? value("3C")
> ? value("4D")
> ? value("5E")
> ? value("6F")
ummmmmm
unless i miss my guess....
why don't we try:
? value("#1a")
? value("#2b")
? value("#3c")
? value("#4d")
? value("#5e")
? value("#6f")
? value("#1A")
? value("#2B")
? value("#3C")
? value("#4D")
? value("#5E")
? value("#6F")
of course... this would be assuming that u are after hexadecimal,
which, from the lettering being a..f, i would have to assume...
i think that may work like you want??
if you aren't after hexadecimal, then please ignore this msg :)
--Hawke'
5. Re: error in value()?
Hawke' wrote:
...
> of course... this would be assuming that u are after hexadecimal,
> which, from the lettering being a..f, i would have to assume...
No I'm not after HEX-vals..., only the case one is reading inkeyed strings
which should represent numbers. In case the string does not represent a
legal number (mistyped), value should answer with an error = {1,0}.
But thank you for response so late in the night :), Rolf