Problem with scanf reading long types in scientific notation

2011-05-17 Thread Sean Robert McGuffee
Hi,
I¹m not sure if this have been dealt with or not, but I happen to be
thinking about it at the moment and wanted to say something before I forget.
There is as situation in which I believe an improvement is needed:
Regarding all the scanf functions reading long values
(sscanf,fscanf,scanf,... etc...).
Currently, if a number is written in scientific notation (as will be the
default case sometimes for large whole numbers that might happen to be
stored in double types), scanf won¹t properly read it¹s value into a long
data type. For example:
if I want to read the number
15892938475
or 
1.5892938475E10, 1.5892938475e10, 1.5892938475E+10, or 1.5892938475e+10
scanf(³%ld²,&longValue) ;will not read any of the later cases correctly. I
imagine the same to be true for int types.
Currently, what I have to do is:
scanf(³%ld²,&doubleValue);longValue=doubleValue;
I don¹t think I should have to write my own functions to deal with this type
of standard read of plain old data, so whether it¹s a bug or just a feature
request is semantics.
The introduction of 64-bit systems after everything was developed for 32-bit
systems has caused one set of issues. This may be related to that, but it
also might be seen as a preference for large whole numbers to be more be
more easily stored and converted between long and double values. Maybe the
desire for this has come out of dealing with large numbers available in
64-bit systems. 
In my opinion, it should be changed so that scanf(³%ld²,&longValue) behaves
as scanf(³%ld²,&doubleValue);longValue=doubleValue;, specifically to improve
the reading of scientific numbers. It is entirely possible to have a large
whole number written in scientific notation. I feel that this issue has
caused bugs in many of my programs, so it should be fixed in order that
others in the future can have confidence in the functionality of
scanf(³%ld²,&longValue) working correctly in all cases where there is a
number to be read. I propose that it be set up this way for all versions of
*scanf type functions. I don¹t know if literally using the double reading
algorithm and then assigning to a long or int value is the best approach or
if there is a better way, but I think the functionality should be
implemented in the future.
Thanks,
Sean McGuffee




Compiling Netbeans with GCJ?

2011-05-17 Thread Sean Robert McGuffee
Hi, 
Has anyone compiled netbeans with gcj?
If so, can you please post your method?
Thanks,
Sean




Re: Compiling Netbeans with GCJ?

2011-05-18 Thread Sean Robert McGuffee
Is the Classpath library that gcj uses something that could be updated to
have everything Netbeans needs? Netbeans has grown on me in functionality.
It's just that it uses like 2 gigs of memory and is often very slow when
many files are open. I imagine if there ever were a case for gcj's
existence, a non-interpreted version of Netbeans might be it.
Sean


On 5/18/11 4:34 AM, "Andrew Haley"  wrote:

> On 17/05/11 19:16, Sean Robert McGuffee wrote:
>> Hi, 
>> Has anyone compiled netbeans with gcj?
>> If so, can you please post your method?
> 
> I don't think so.
> 
> I'm sure gcj could compile Netbeans, but I am not at all sure that
> the Classpath library that gcj uses has everything Netbeans needs.
> Definitely not a first gcj project.
> 
> Andrew.