Article View: alt.comp.sys.palmtops.pilot
Article #197Re: Mathlib functions always returning 0
From: Luc
Date: Sun, 09 Nov 2003 03:45
Date: Sun, 09 Nov 2003 03:45
40 lines
2533 bytes
2533 bytes
This turned out to be a compilation problem. I used PRC-Tools 2.0 and
recompiling the same code with CW 9.2 fixed the problem.
Luc
"Luc M." <luc_martineau@hotmail.com> wrote in message
news:7Q0lb.2265$aw5.156000@news20.bellglobal.com...
> I get '0' from a mathlib functions when I try to pass a parameter.
> The functions return the proper value if the parameter is checked before
> calling the function.
>
> Assuming 'index' is equal to 2, why does the function 'sqrt(index)' return
0
> in the following code:
>
> Int32 index;
> double c;
>
> index = StrAToI(FldGetTextPtr(fldInput)); /* field set so that
index
> is 2 */
> c = sqrt(index); /*
Returns
> 0 ? */
>
>
> But it returns the proper value in the following code:
>
> index = StrAToI(FldGetTextPtr(fldInput)); /* field set so that index
> is 2 */
> if(index == 2)
> {
> c = sqrt(index); /* Returns
> proper value !!! */
> }
>
>
> Any help is greatly appreciated.
>
>
Technical Details
Message-ID:
<4Lirb.11244$Pg1.646671@news20.bellglobal.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mailReferences:
<7Q0lb.2265$aw5.156000@news20.bellglobal.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109e18,9fa37096d9ae1ba3 X-Google-Attributes: gid109e18,public X-Google-Thread: 10baa0,9fa37096d9ae1ba3 X-Google-Attributes: gid10baa0,public X-Google-Thread: 112073,9fa37096d9ae1ba3 X-Google-Attributes: gid112073,public X-Google-Thread: 11219a,9fa37096d9ae1ba3 X-Google-Attributes: gid11219a,public X-Google-ArrivalTime: 2003-11-08 20:00:22 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!sjc70.webusenet.com!news.webusenet.com!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Reply-To: "Luc" <abc@net.com> From: "Luc" <abc@net.com> Newsgroups: alt.comp.sys.palmtops.pilot,comp.sys.palmtops,comp.sys.palmtops.pilot,codewarrior.palm References: <7Q0lb.2265$aw5.156000@news20.bellglobal.com> Subject: Re: Mathlib functions always returning 0 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <4Lirb.11244$Pg1.646671@news20.bellglobal.com> Date: Sat, 8 Nov 2003 22:45:02 -0500 NNTP-Posting-Host: 67.68.207.25 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1068349504 67.68.207.25 (Sat, 08 Nov 2003 22:45:04 EST) NNTP-Posting-Date: Sat, 08 Nov 2003 22:45:04 EST Organization: Bell Sympatico