User Tools

Site Tools


nth_root_of_x

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
nth_root_of_x [2014/03/31 23:51]
Jay.Tanner.x@PHPScienceLabs.us
nth_root_of_x [2015/06/22 23:49]
Jay.Tanner.x@PHPScienceLabs.us
Line 1: Line 1:
 ~~NOCACHE~~ ~~NOCACHE~~
 ~~DISCUSSION:​off~~ ~~DISCUSSION:​off~~
 +Back to:  **[[Arbitrary-Precision Math]]** \\
 =====Nth Root of X===== =====Nth Root of X=====
-Sometimes we may want to compute a square root or a cube root or a fifth root some other root of a number to some specified degree of precision. The function below will compute the arbitrary-precision Nth root of argument X.  As with all BC math functions, the X argument should be given as a numerical string, between quotes, like "​1.2345"​ or '​1.2345',​ so as not to be misinterpreted as a standard floating point value.+Sometimes we may want to compute a square root or a cube root or a fifth root some other root of a number to some specified degree of precision. The function below will compute the arbitrary-precision Nth root of argument X.  As with all BC math functions, the X argument should be given as a numerical string, between quotes, like "​1.2345"​ or '​1.2345',​ so as not to be misinterpreted as a standard ​double-precision ​floating point value.
 \\ \\
 <​code>​ <​code>​
-A general-purpose root computation function ​is based on a simple iterative algorithm.+A general-purpose, arbitrary-precision,​ Nth root computation 
 +function based on a simple iterative algorithm.
  
 Let: Let:
Line 168: Line 169:
  
  
-   ​function ​bcNth_Root_Of_X ​($N, $X, $NumDecimals=16)+   ​function ​bcNth_Root_of_X ​($N, $X, $NumDecimals=16)
 { {
    $a = sprintf("​%1.16f",​ pow($X, 1/$N)); // Compute first approximation    $a = sprintf("​%1.16f",​ pow($X, 1/$N)); // Compute first approximation
nth_root_of_x.txt · Last modified: 2015/06/23 00:01 by Jay.Tanner.x@PHPScienceLabs.us