[gecode-users] Decimal
Christian Schulte
cschulte at kth.se
Wed May 20 09:34:21 CEST 2009
I think you should go for float variables, however I do not know whether
they have been ported to 3.* Any comment
Christian
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Javier Andrés Mena Zapata
Sent: Tuesday, May 19, 2009 9:30 PM
To: gecode list
Subject: [gecode-users] Decimal
Hi,
I'm modelling a financial problem (calculating minimum interests payments
and ROI), and I want to model the "money" value using Gecode integer
variables.
For example, representing 10.25 is like storing 1025 divided by 100. But,
there's a problem with the multiplication, because the interests rates are
float values with very muchs decimals. For example 0.00643403011. I think
there may be an overflow if I model this decimal using something like 6434
divided by 1000000.
What do you think it's the best technique for modelling this problem:
1. Use IntVars and the current propagators (as proposed here).
2. Use IntVars, and creating new propagators for IntVar x Float
multiplication.
3. Use float vars, and its propagators.
4. Other?
Thanks,
--
Javier Andrés Mena Zapata
http://StrategicDecision.net/
Cali - Colombia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090520/ed54ac2b/attachment.htm>
More information about the gecode-users
mailing list