# arithmoi

committed d2fbb0b

Comment out as yet unused function

# Math/NumberTheory/Powers/General.hs

`     , isKthPower`
`     , isPerfectPower`
`     , highestPower`
`-    , largePFPower`
`+--     , largePFPower`
`     ) where`
` `
` #include "MachDeps.h"`
` import Data.List (foldl')`
` import qualified Data.Set as Set`
` `
`-import Math.NumberTheory.Logarithms`
`+-- import Math.NumberTheory.Logarithms`
` import Math.NumberTheory.Logarithms.Internal (integerLog2#)`
` import Math.NumberTheory.Utils (shiftToOddCount, splitOff)`
` import qualified Math.NumberTheory.Powers.Squares as P2`
` -- | Calculate an integer root, @'integerRoot' k n@ computes the (floor of) the @k@-th`
` --   root of @n@, where @k@ must be positive.`
` --   @r = 'integerRoot' k n@ means @r^k <= n < (r+1)^k@ if that is possible at all.`
`---   It is impossible if @k@ is even and @n < 0@, since then @r^k >= 0@ for all @r@,`
`+--   It is impossible if @k@ is even and @n \< 0@, since then @r^k >= 0@ for all @r@,`
` --   then, and if @k <= 0@, @'integerRoot'@ raises an error. For @k < 5@, a specialised`
` --   version is called which should be more efficient than the general algorithm.`
` --   However, it is not guaranteed that the rewrite rules for those fire, so if @k@ is`
`       sqr 0 m = m`
`       sqr k m = sqr (k-1) (m*m)`
` `
`--- | @'largePFPower' bd n@ produces the pair @(b,k)@ with the largest`
`---   exponent @k@ such that @n == b^k@, where @bd > 1@ (it is expected`
`---   that @bd@ is much larger, at least @1000@ or so), @n > bd^2@ and @n@`
`---   has no prime factors @p <= bd@, skipping the trial division phase`
`---   of @'highestPower'@ when that is a priori known to be superfluous.`
`---   It is only present to avoid duplication of work in factorisation`
`---   and primality testing, it is not expected to be generally useful.`
`---   The assumptions are not checked, if they are not satisfied, wrong`
`---   results and wasted work may be the consequence.`
`-largePFPower :: Integer -> Integer -> (Integer, Int)`
`-largePFPower bd n = rawPower ln n`
`-  where`
`-    ln = integerLogBase' (bd+1) n`
`+-- Not used, at least not yet`
`+-- -- | @'largePFPower' bd n@ produces the pair @(b,k)@ with the largest`
`+-- --   exponent @k@ such that @n == b^k@, where @bd > 1@ (it is expected`
`+-- --   that @bd@ is much larger, at least @1000@ or so), @n > bd^2@ and @n@`
`+-- --   has no prime factors @p <= bd@, skipping the trial division phase`
`+-- --   of @'highestPower'@ when that is a priori known to be superfluous.`
`+-- --   It is only present to avoid duplication of work in factorisation`
`+-- --   and primality testing, it is not expected to be generally useful.`
`+-- --   The assumptions are not checked, if they are not satisfied, wrong`
`+-- --   results and wasted work may be the consequence.`
`+-- largePFPower :: Integer -> Integer -> (Integer, Int)`
`+-- largePFPower bd n = rawPower ln n`
`+--   where`
`+--     ln = integerLogBase' (bd+1) n`
` `
` ------------------------------------------------------------------------------------------`
` --                                  Auxiliary functions                                 --`
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.