• Subject: Re: Cube root
  • From: "Richard Thomas" <RichardThomas@xxxxxxx>
  • Date: Wed, 21 Feb 2001 09:32:53 +0300

Hi Walter,
 
Yikes! I've never had to do this in RPG before...
 
I can only suggest that you use RPG IV and a couple of procedures exports in service program QC2UTIL1, namely 'pow' and 'log10'.
 
Then you could say that the cube root of a number, X, is 10 to the power of (LogX/3).
 
E.G.    CubeRoot of 512 is 10 to the power of 2.7093/3 which equals 10 to the power of 0.9031 = (approximately) 8.
 
Naturally, the more decimal positions you allow for the logarithm value, the more accurate the results.
 
I'm sure there are people on the list who can provide you with a better or more elegent solution than this, but it's the best I can come up with for now.
 
Best wishes,
 
Richard
----- Original Message -----
Sent: Thursday, February 15, 2001 12:05 AM
Subject: Cube root

Hi all,
 
I would like to know a way to calculate the cube root of a number. We are on V4R4.
 
Thanx.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.