1. adding numbers
- Posted by Orpheus Mullen <orpheus_mullen at btopenworld.com> Jun 05, 2002
- 416 views
This is a multi-part message in MIME format. ------=_NextPart_000_005A_01C20CD9.60765700 charset="iso-8859-1" In My latest program I Need tobe abble to add two numbers which apper in = a sequence together E.g "{1,6) =3D {16}" This probaly is very trivial = but it really needs to be done ------=_NextPart_000_005A_01C20CD9.60765700 charset="iso-8859-1" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3D"Times New Roman">In My latest program I Need tobe = abble to add=20 two numbers which apper in a sequence together E.g "{1,6) =3D {16}" This = probaly=20 is very trivial but it really needs to be = ------=_NextPart_000_005A_01C20CD9.60765700--
2. Re: adding numbers
- Posted by "C. K. Lester" <cklester at yahoo.com> Jun 05, 2002
- 424 views
In My latest program I Need tobe abble to add two numbers which apper in a sequence together E.g "{1,6) = {16}" This probaly is very trivial but it really needs to be done Well, first off, you should try to capture them differently so they're not in a sequence. If that's just totally impossible, well... uh... We'll cross that bridge if we have to.
3. Re: adding numbers
- Posted by Sabal.Mike at notations.com Jun 05, 2002
- 400 views
sequence n object v n = {1,6,2,3,4,0} n+=48 -- the ascii value of '0', assumes n[x] is between 0 and 9. v = value(n) if v[1]=GET_SUCCESS then v=v[2] end if HTH, Michael J. Sabal >>> orpheus_mullen at btopenworld.com 06/05/02 04:38PM >>> In My latest program I Need tobe abble to add two numbers which apper in a sequence together E.g "{1,6) = {16}" This probaly is very trivial but it really needs to be done
4. Re: adding numbers
- Posted by Evan Marshall <evan at net-link.net> Jun 05, 2002
- 396 views
sequence a,b a = {1,6} b = {a[1]*10+a[2]} C. K. Lester wrote: > > > >In My latest program I Need tobe abble to add two numbers which apper in a >sequence together E.g "{1,6) = {16}" This probaly is very trivial but it >really needs to be done > > >Well, first off, you should try to capture them differently so they're not >in a sequence. If that's just totally impossible, well... uh... We'll cross >that bridge if we have to. > > > >
5. Re: adding numbers
- Posted by a.tammer at hetnet.nl Jun 05, 2002
- 382 views
Hi Here's the solution: sequence a a=3D(1,6) a=3D10*a[1]+a[2] EUrs Antoine
6. Re: adding numbers
- Posted by a.tammer at hetnet.nl Jun 05, 2002
- 405 views
OOPS sequence a a=3D{1,6} a=3D {10*a[1]+a[2]} This should do ie the correct way I guess Didn't test. maybe result wil be {{16}} antoine
7. Re: adding numbers
- Posted by "Carl W." <euphoria at cyreksoft.yorks.com> Jun 06, 2002
- 433 views
"Derek Parnell" wrote: > That all depends on what the specification is. Some examples might help > here... > > So far we know that > {1,6} ==> {16} > must be true > > but we are assuming > {23,17} ==> {247} > > or this > {23, 17} = {2317} > > That is why clear specifications are so important for programming. Here's a quick kluge that deals with some of the apparent problems, but introduces a whole heap of others ;) ...: -- Warning! No error or bounds checking in this code! sequence in, outseq integer out in = {1, 23, 456} outseq = "" out = 0 -- want this to be 123456 for i = 1 to length(in) do outseq &= sprintf("%d", in[i])-'0' end for for i = 1 to length(outseq) do out = out * 10 + outseq[i] end for ? out Carl