velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BOUTERFASS Mostapha <mostapha.bouterf...@gmail.com>
Subject Float precison
Date Fri, 06 Feb 2009 16:28:59 GMT
Hi all
i put in my context 3 float  : v1 = 2  v2 = 11  v3 = 0.1

in my template i have

#set( $mnt = (100 * v1 * v2 / (1 + v3)))
v1 = $v1
v2 = $v2
v3 = $v3
mnt = $mnt


after execution i have this result
v1 = 2.0
v2 = 11.0
v3 = 0.1
mnt = 1999.9999999999998


but the right result mast be mnt = 2000  !!!


how can i resolve this problem


thanx in advence
and sorry for mu english

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message