how i get an accurate answer of this | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

how i get an accurate answer of this

(0.001/i^i) i=from 1to1000 in java when i do the loop the answer will be 0

17th Apr 2018, 6:13 PM
ABADA S
ABADA S - avatar
9 Answers
+ 2
But isn't ^ the xor operator?
18th Apr 2018, 5:37 AM
Jonas Schröter
Jonas Schröter - avatar
+ 14
Mmmh, what output did you expect? If the dividend is constant and the divisor gets bigger and bigger (nearing infinity), the quotient will come near to 0 (limit value examination). Double can't hold infinite decimal places, so the result will be 0.0 from a certain iteration onwards.
17th Apr 2018, 7:05 PM
Tashi N
Tashi N - avatar
+ 9
Like that? import java.util.*; //... Math.pow(10, -100);
18th Apr 2018, 6:43 AM
Tashi N
Tashi N - avatar
+ 7
Jonas Schröter It is, but as this doesn't make sense in this context, I assumed it to mean i to the power of i.
18th Apr 2018, 5:38 AM
Tashi N
Tashi N - avatar
+ 7
‎‏‪ABADA S‬‏‎ Sorry, but get what? What result do you expect?
18th Apr 2018, 6:37 AM
Tashi N
Tashi N - avatar
+ 3
Tashi N Thanks for this information ... so is not it possible to get this
18th Apr 2018, 6:15 AM
ABADA S
ABADA S - avatar
+ 3
1*10-^100
18th Apr 2018, 6:39 AM
ABADA S
ABADA S - avatar
+ 3
first i can call this method without any import second i don't want this number like that i want to show this by division ,, thanks
22nd Apr 2018, 8:07 AM
ABADA S
ABADA S - avatar
+ 1
Well, that was my thought also
18th Apr 2018, 5:39 AM
Jonas Schröter
Jonas Schröter - avatar