How to handle large number?

Problems with modeling
Post Reply
Yehuda
User
User
Posts: 10
Joined: 6 years ago

How to handle large number?

Post by Yehuda »

Hi everyone,

I have a very large number in my input dataset, it's roughly 3.6E260. As far as I understand, GAMS just ignore this huge number (that explains the strange results I got...).
I was wondering if someone knows how can I change the limit for the model so it can handle this number? Or alternatively, if there are other options to handle this situation?

Thank you,
Yehuda
User avatar
dirkse
Moderator
Moderator
Posts: 215
Joined: 7 years ago
Location: Fairfax, VA

Re: How to handle large number?

Post by dirkse »

Yehuda,

What makes you think this number is ignored? A simple example shows it is not:

Code: Select all

scalar yehuda 'this is a pretty big number' / 3.6e260 /;
display yehuda;
I see the number displayed in the .lst file.

-Steve
Yehuda
User
User
Posts: 10
Joined: 6 years ago

Re: How to handle large number?

Post by Yehuda »

Hi Steve,
For a long time, I was not having any result in my Excel output file, for a calculation I made with this number and I thought that this is a small malfunction but everything is okay. Lately, when I double-checked some results of my model I realized that this number is actually doesn't process by the model. Furthermore, in the user's guide, it says: "One should avoid creating or using numbers with absolute values larger than 1.0E20". I guess this is not accurate since I have some numbers that are larger than this and they are processed correctly, but as far my understanding, a large number like I mentioned before is too big for the software.
Post Reply