SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Nazbuster who wrote (6412)9/7/1998 7:30:00 PM
From: Sean W. Smith  Read Replies (1) of 11149
 
Daniel,

Your problem is caused by the implicit type casting. 1/8 means integer divide 1/8 which is 0. 1.0/8 yields .125 as you expect.
The same features are found in C and many other languages. There no explicit type casts in QP. This will work...

output="tst.lst";
float dec, fr;
dec:= 1 + .125; fr:= 1 + 1.0/8;
println symbol,",",dec,",",fr;

Sean
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext