From: Ken A. <kan...@bb...> - 2002-12-30 19:53:02
|
Tim, I think i should refactor the stringToNumber code to determine the type and size of the number and then attempt an appropriate conversion. readWholeNumber seems more complicated than it needs to be, for example it treats negative numbers specially were you trying to get around some limitation? Unfortunately, I've noticed that Integer.parseInt throws a numeric exception for numbers such as 0xDadaCafe 0x80000000 02000000000, while our current code returns a Long. Long.parseLong has a similar problem. So, the best thing might be to use Long.parseLong and then .intValue to get an Integer. I presume this has to do with numbers being signed, At 10:48 AM 12/30/2002, Jonathan A Rees wrote: >I believe the following behavior is incorrect (according to the scheme >report). > > Jscheme 5.0 04/05/2002 http://jscheme.sourceforge.net > > (string->number "01438") > 1438.0 > > > >It should be more like the following: > > > (string->number "1438") > 1438 > > > >Jonathan > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |