Skip to main content
gamedev.net
🔒 Locked

Java double question.

Started by MDI Mar 22, 2005 at 7:53 AM 0 replies 400+ views
Original Post
MDI
MDI
Does anyone know why

public class Raytracer {
	private static int left = -4;
	private static int right = 4;
	private static int bottom = -3;
	private static int top = 3;
	private static int imageHeight = 600;
	private static int imageWidth = 800;
	private static int diffX = right - left;
	private static int diffY = top - bottom;
	private static double deltaX = diffX / imageWidth;
	private static double deltaY = diffY / imageHeight;

        public static void main(String args[]) {
                ...
        }
}
both deltaX and deltaY are always 0.0 when I evaluate this? It's driving me daft, I know there's a simple explanation but I can't see it. TIA

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.