From 224844323606b6a2d76bf36946964c3f8fe02e24 Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Wed, 24 Apr 2019 12:45:10 -0500 Subject: E --- ee1301/wk6/lab5/vectorArray.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ee1301') diff --git a/ee1301/wk6/lab5/vectorArray.cpp b/ee1301/wk6/lab5/vectorArray.cpp index 8d2ad38..6e2d548 100644 --- a/ee1301/wk6/lab5/vectorArray.cpp +++ b/ee1301/wk6/lab5/vectorArray.cpp @@ -35,9 +35,9 @@ double randVec() { double momentum(double velocity) { double mass; if (rand()%2+1==0) { - mass=rand()%10+1; + mass=rand()%10+1.0; } else { - mass=rand()%10*-1+1; + mass=rand()%10*-1.0+1.0; } - return velocity*mass; + return mass*velocity; } \ No newline at end of file -- cgit v1.2.3