Hello everybody!
As I already have had a problem with compilation under unix, I would like to know if this following error is something related to or something else: bathy.p: In function `Principal': bathy.p:977: constant out of range
The line in question is: for ii:=1 to nsites do begin larves[ii]:=round(0.7*pop_max*fec*sex*ferti);
and the constant: const r = 1000000; pop_max = 750000; max = 10000; sex = 0.5; fec = 1000000; ferti = 0.8;
I don't really understand because if I run a little program only with these lines, it works, but not in the whole program. And, the whole program with lower values works. So, do I have to declare the constants with something else?... Or what?...
Thanks a lot in advance,
Nathalie
________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Hi
On Mon, 17 Jul 2000, Nathalie Jarosz wrote:
Hello everybody!
As I already have had a problem with compilation under unix, I would like to know if this following error is something related to or something else: bathy.p: In function `Principal': bathy.p:977: constant out of range
The line in question is: for ii:=1 to nsites do begin larves[ii]:=round(0.7*pop_max*fec*sex*ferti);
and the constant: const r = 1000000; pop_max = 750000; max = 10000; sex = 0.5; fec = 1000000; ferti = 0.8;
I don't really understand because if I run a little program only with these lines, it works, but not in the whole program. And, the whole program with lower values works. So, do I have to declare the constants with something else?... Or what?...
Nope
It looks like larves[ii] is declared as an array of integer. Internally, numbers are stored in binary form. Therefore you are trying to put 210000000000 into a space that can only hold about 2000000000.
You have 2 choices: array of real or array of comp
program fud; const pmax = 750000; fec = 1000000; sex = 0.5; fer = 0.8; var l : real; m : comp; begin l := round( 0.7 * pmax * fec * sex * fer); writeln( l:3:0 ); m := round( 0.7 * pmax * fec * sex * fer); writeln( m ); end.
Good Luck, Russ