Re: [WebDNA] divisible by 1

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106949
interpreted = N
texte = Thanks Bill and Marc for your suggestions.. and for your tests and last = solution Ken. I never tested anything other than the likes of "abc" in my *really old* = original tests.. and so all these years never realizing multiplying by = zero was not robust enough a test. I too would call it = (multiplying-by-zero's failure to realize the lack of a number) a bug, = Ken.. but meanwhile especially Marc's test (IMHO) is the easiest test = yet: [text]vals2test=3D123.45|123,45|123,456|123.a|abc|123|123 = 45|[kart][/text] [ListWords Words=3D[URL][vals2test][/URL]&Delimiters=3D|] [index].) [word]: [if ("[URL][math = show=3DT]1*[word][/math][/URL]"=3D"[URL][word][/URL]")][then]it's a number![/then][else]it's NOT a number![/else][/if]
[/ListWords] -Govinda > I decided to check every char via [listchars] but the code=20 > is relatively simple and it actually works now. >=20 > Sincerely, > Kenneth Grome >=20 >=20 >=20 >>> off the top of my head, I think I would just multiply >>> by zero to confirm a number ... >>=20 >> Good thought except that it doesn't work. Half my tests >> produce the wrong value when I multiply by zero: >>=20 >> [math]0*123.45[/math] =3D 0 -- correct >> [math]0*123,45[/math] =3D 45 -- WRONG, should be blank >> [math]0*123.a[/math] =3D 0 -- WRONG, should be blank >> [math]0*abc[/math] =3D (blank) -- correct >> [math]0*123[/math] =3D 0 -- correct >> [math]0*123 45[/math] =3D 0 -- WRONG, should be blank >>=20 >> I also tried the module operator with similar results. >>=20 >> Maybe this should be a considered a bug since [math] >> should return a blank result if one of the values in the >> formula is non-numeric. Don't you think? >>=20 >> As it is now we can never trust that the values used in a >> [math] calculation are actually numbers when non-numbers >> are producing results like 0 or 45. >>=20 >> :( >>=20 >> Sincerely, >> Kenneth Grome >=20 - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] divisible by 1 (Marc Thompson 2011)
  2. Re: [WebDNA] divisible by 1 (Donovan Brooke 2011)
  3. Re: [WebDNA] divisible by 1 (Christer Olsson 2011)
  4. Re: [WebDNA] divisible by 1 (Donovan Brooke 2011)
  5. Re: [WebDNA] divisible by 1 (Stuart Tremain 2011)
  6. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  7. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  8. Re: [WebDNA] divisible by 1 (Stuart Tremain 2011)
  9. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  10. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  11. Re: [WebDNA] divisible by 1 (Govinda 2011)
  12. Re: [WebDNA] divisible by 1 (Govinda 2011)
  13. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  14. Re: [WebDNA] divisible by 1 (Ronald Kirkland 2011)
  15. Re: [WebDNA] divisible by 1 (Marc Thompson 2011)
  16. Re: [WebDNA] divisible by 1 (William DeVaul 2011)
  17. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  18. Re: [WebDNA] divisible by 1 (Kenneth Grome 2011)
  19. Re: [WebDNA] divisible by 1 (Govinda 2011)
  20. [WebDNA] divisible by 1 (Kenneth Grome 2011)
Thanks Bill and Marc for your suggestions.. and for your tests and last = solution Ken. I never tested anything other than the likes of "abc" in my *really old* = original tests.. and so all these years never realizing multiplying by = zero was not robust enough a test. I too would call it = (multiplying-by-zero's failure to realize the lack of a number) a bug, = Ken.. but meanwhile especially Marc's test (IMHO) is the easiest test = yet: [text]vals2test=3D123.45|123,45|123,456|123.a|abc|123|123 = 45|[kart][/text] [ListWords Words=3D[url][vals2test][/URL]&Delimiters=3D|] [index].) [word]: [if ("[url][math = show=3DT]1*[word][/math][/URL]"=3D"[url][word][/URL]")][then]it's a number![/then][else]it's NOT a number![/else][/if]
[/ListWords] -Govinda > I decided to check every char via [listchars] but the code=20 > is relatively simple and it actually works now. >=20 > Sincerely, > Kenneth Grome >=20 >=20 >=20 >>> off the top of my head, I think I would just multiply >>> by zero to confirm a number ... >>=20 >> Good thought except that it doesn't work. Half my tests >> produce the wrong value when I multiply by zero: >>=20 >> [math]0*123.45[/math] =3D 0 -- correct >> [math]0*123,45[/math] =3D 45 -- WRONG, should be blank >> [math]0*123.a[/math] =3D 0 -- WRONG, should be blank >> [math]0*abc[/math] =3D (blank) -- correct >> [math]0*123[/math] =3D 0 -- correct >> [math]0*123 45[/math] =3D 0 -- WRONG, should be blank >>=20 >> I also tried the module operator with similar results. >>=20 >> Maybe this should be a considered a bug since [math] >> should return a blank result if one of the values in the >> formula is non-numeric. Don't you think? >>=20 >> As it is now we can never trust that the values used in a >> [math] calculation are actually numbers when non-numbers >> are producing results like 0 or 45. >>=20 >> :( >>=20 >> Sincerely, >> Kenneth Grome >=20 - Govinda -------------- Old WebDNA talklist archives: http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk Govinda

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Can ShowNext do this? SOLVED (2000) This message couldn't reach the list! (1998) & in Lookups (1997) Where is Typhoon 3.x? (2000) Payment Calculator? (2000) [OT] Stuff (2002) Re[2]: 2nd WebCatalog2 Feature Request (1996) Emailer+NetTen [same machine]=? (2000) Repost: Orderfile, Grandtotal: How do I get it to all add up. (2000) Searching Multiple DBs (1997) Bug Report, maybe (1997) security (1997) [date format] w/in sendmail (1997) RE: OK, here goes... (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) WebDNA Solutions ... sorry! (1997) my SOS last week... (1996) database size? (1997) Apoligy (1997) Using the sendmail command on CGate Pro (Unix) (2000)