« first day (4065 days earlier)      last day (868 days later) » 

12:00 AM
FORTUNE'S FUN FACTS TO KNOW AND TELL: A firefly is not a fly, but a beetle. (source)
 
 
2 hours later…
1:40 AM
hums a song
 
 
3 hours later…
4:23 AM
 
 
1 hour later…
5:24 AM
Unihedron completed parts 1 and 2 of day 9! \o/
 
5:56 AM
Hi, why does double y = 2+10/(4-1) return 5.0? It should be 5.33...(even with double?) right?
 
 
3 hours later…
9:09 AM
Matthieu Honel completed part 1 of day 9! \o/
 
9:39 AM
Matthieu Honel completed part 2 of day 9! \o/
 
 
2 hours later…
11:15 AM
@CoolCloud Nope. The division on the right side of the assignment is 10 / 3 and since neither of the two is a double, the division that happens is an int division where the remainder is ignored so 10 / 3 in Java is 3. 3 + 2 then is 5 and since it's assigned to a double value, you get a cheeky .0 in the end.
To mitigate this issue, you can simply add a .0 to any of the party people in the division (so the 10, 4 or 1) to enforce the conversion to a double making the whole thing (using 10 as the example): 2 + 10.0 / 3 -> You are now dividing a double by an int, so the result is not truncated as when you are dividing an int by an int
There are a couple of questions on that topic on the site like this and this. The general search term for more information is "java int division"; you should find plenty resources with that :)
 
11:54 AM
Madara Uchiha completed part 1 of day 9! \o/
 
 
1 hour later…
12:55 PM
Madara Uchiha completed part 2 of day 9! \o/
 
 
4 hours later…
4:52 PM
Hi
 
@TurnusSilver Welcome to the Java Chat, the room for Java enthusiasts! I'm Oak, one of the room's bots. If you want to ask a question, just ask it and someone will respond if they feel like it. But remember that this room is not a help desk or tutoring service! If you want to just hang out, then welcome aboard! Oh, and the room's full list of rules are posted here.
 
 
2 hours later…
6:25 PM
@geisterfurz007 Thanks mate, that makes it clear
 
 
1 hour later…
7:40 PM
fredoverflow completed part 1 of day 9! \o/
 
 
1 hour later…
8:40 PM
fredoverflow completed part 2 of day 9! \o/
 
9:10 PM
Olivia (Zoe) completed part 1 of day 8! \o/
 
Zoe
Part 2 is such bullshit
 
9:40 PM
Olivia (Zoe) completed part 1 of day 9! \o/
 

« first day (4065 days earlier)      last day (868 days later) »