Mantis - Squeak Packages
Viewing Issue Advanced Details
7316 Numerical Analysis minor always 03-16-09 13:13 03-20-09 17:52
glenpaling  
 
normal  
new  
open  
none    
none  
0007316: Didier Besset's Numerical Analysis Replacement of String asInteger Causes Bug
See: 0007197: DateAndTime readFrom: Results are About 2 Seconds Early.

'2008-08-28' asDateAndTime 2008-08-27T23:59:57.999999995+00:00
'2006-08-28T00:00' asDateAndTime 2006-08-27T23:59:57.999999995+00:00.

sUnit catches this bug too. It's due to Didier Besset's Numerical Analysis package from universes. It replaces String asInteger with:

asInteger
        "(c) Copyrights Didier BESSET, all rights reserved
         Initial code: 1/6/98 "
    ^self inject: 0
            into: [ :ans :each | (ans * 10) + each digitValue]

It naively assumes that all characters are valid digits. asDateAndTime also places a plus sign into the conversion buffer. digitValue happily converts $+ to -5.

The original asInteger is coded as ^self asSignedInteger. Didier Bessets version of asInteger should be removed from the Numerical Analysis package.

Notes
(0013042)
KenCausey   
03-16-09 16:36   
I have added a Numerical Analysis category but as far as I can tell Didier Besset has no account on this Mantis. So I recommend that you contact him directly informing him of the existence of this issue.
(0013044)
lexspoon   
03-17-09 15:55   
I'd recommend just removing the package, if Didier Besset can't be found and no one else wants to step up to maintain it. Damien, can you do it?
(0013052)
glenpaling   
03-18-09 23:44   
Joshua Gargus is listed as maintainer on Squeakmap. Home page is on sourceforge: http://sourceforge.net/projects/dhbnumerics/. [^] No activity for seven years though.

Joshua is still around as he recently posted on Squeak-Dev. I'll email him.
(0013054)
glenpaling   
03-20-09 17:52   
Joshua isn't interested. I'll volunteer to do it. I'm not up to all the math that's in the package but I can at least render it harmless by removing or renaming method overwrites. I do have the book! I see on sourceforge a newer VW version with a couple of bug fixes and some unit tests. I'll have a look bringing it into Squeak.