You can use public Double valueOf()
Thanx a lot jim for ya advice & answers. Hey I've 1 more question which I've long tested. When I try to declare float a= 2.0 compiler dosen't allow me 2 do that but I can declare it as a double. What's the reason behind this?
try working out this! take look at the bold secyion.
$> cat Hello.html
< !DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
applet codebase="[your current directory!]" code="HelloWorld.class" width=300 height=50
Hope this helps your cause & if not please tell me & I'll try something else.
all the best
bye
Originally posted by Jim Yingst:
For your first question - for a = 20 the correct result is 3890875847. This is too big to fit into an int value (maximum value 2147483647) so roundoff error occurrs. The value is converted to an int value by truncating all but the lowest 32 bits - which, as it happens, leaves a negative value in this case. Basically, if you overflow the value of an int (or other integral type), the value is meaningless. The simple workaround in this case is to declare arg as long rather than int. If that eventaully overflows as well, switch to BigInteger (which will require other code changes as well).
As for your second question - let's see, for a = 19 the value of arg is 1743392200. Are you saying that you tried to create three arrays of size 1743392200, and you're not sure why you would run out of memory? Perhaps I have misunderstood your question.