[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unable to calculate logs in SWARM
From: |
Laurence Clark |
Subject: |
unable to calculate logs in SWARM |
Date: |
Thu, 05 Nov 1998 15:06:27 +0000 |
Hi,
I have been having problems using the log10(double) function from with my
SWARM application. (I'm using SWARM 1.2 under Linux Redhat 5.0)
The following function:
// add an entry to the table
-addEntry:(char *) r result: (char *) r2 rateConstant: (float) c signalSent:
(int) s {
Reaction * entry;
entry = [Reaction create: [self getZone]];
[entry setReaction:r result: (char *) r2 rateConstant:c signalSent:s];
[ReactionList addLast: entry];
printf("Reaction: %s => %s added.\n", r, r2);
if (1.0/c < tSim) tSim=1.0/c;
printf("rate=%e, log=%e\n", c, log10(c));
return self;}
yields this output:
Reaction: TT(0)WWAA + asp => asp-TT(0)WWAA added.
rate=6.000000e-07, log=1.753933e-321
Reaction: TT(0)WWAAp + asp => asp-TT(0)WWAAp added.
rate=8.000000e01, log=1.753933e-321
Reaction: asp-TT(0)WWAA => asp + TT(0)WWAA added.
rate=2.500000e07, log=1.753933e-321
Reaction: asp-TT(0)WWAAp => asp + TT(0)WWAAp added.
rate=6.000000e-07, log=1.753933e-321
Reaction: TT(1)WWAA + asp => asp-TT(1)WWAA added.
rate=9.000000e03, log=1.753933e-321
Reaction: TT(1)WWAAp + asp => asp-TT(1)WWAAp added.
rate=5.000000e-02, log=1.753933e-321
The log10() function always gives the same, incorrect answer regardless of
the input. Can anyone help with this?
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
- unable to calculate logs in SWARM,
Laurence Clark <=