numtheory(deprecated)
pdexpand
compute the periodic expansion of a rational number
Calling Sequence
Parameters
Description
Examples
pdexpand(n)
n
-
rational number
Important: The numtheory package has been deprecated. Use the superseding command NumberTheory[RepeatingDecimal] instead.
pdexpand returns the periodic decimal expansion of the given rational number n.
Every rational number has a periodic (or terminating) decimal expansion. The converse is also true; a periodic expansion always represents a rational number.
The result is returned as in the form PDEXPANDs,q,np,p where s is the sign of n, q the positive integer part, np the non-periodic part, and p the periodic part of n.
Use convert/rational to find the rational number of a periodic decimal expansion.
The command with(numtheory,pdexpand) allows the use of the abbreviated form of this command.
withnumtheory:
pdexpand17
PDEXPAND1,0,,1,4,2,8,5,7
convert,rational
17
pdexpand−8374
PDEXPAND−1,1,1,2,1,6
−8374
See Also
convert/rational
evalf
NumberTheory[RepeatingDecimal]
Download Help Document