From e17c04d2b8c97c34969eb9a912a281ae7d5738db Mon Sep 17 00:00:00 2001 From: yangxx Date: Mon, 27 Oct 2003 19:50:37 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@323 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/include/ltt/time.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/include/ltt/time.h b/ltt/branches/poly/include/ltt/time.h index dc0f8ecb..660e7e98 100644 --- a/ltt/branches/poly/include/ltt/time.h +++ b/ltt/branches/poly/include/ltt/time.h @@ -44,13 +44,14 @@ static inline LttTime ltt_time_add(LttTime t1, LttTime t2) static inline LttTime ltt_time_mul(LttTime t1, float f) { LttTime res; - float d = 1.0/f; + float d; double sec; if(f == 0.0){ res.tv_sec = 0; res.tv_nsec = 0; }else{ + d = 1.0/f; sec = t1.tv_sec / (double)d; res.tv_sec = sec; res.tv_nsec = t1.tv_nsec / (double)d + (sec - res.tv_sec) * -- 2.34.1