All rationals have repeating hexadecimal expansions. The operation hexhexHexadecimalExpansion returns these expansions of type HexadecimalExpansion. Operations to access the individual numerals of a hexadecimal expansion can be obtained by converting the value to RadixExpansion(16). More examples of expansions are available in the DecimalExpansionXmpPage , BinaryExpansionXmpPage , and RadixExpansionXmpPage .

This is a hexadecimal expansion of a rational number.

r := hex(22/7)


 3.249‾

Arithmetic is exact.

r + hex(6/7)


 4

The period of the expansion can be short or long ...

[hex(1/i) for i in 350..354]


 [0.00BB3EE721A54D88‾,0.00BAB6561‾,0.00BA2E8‾,0.00B9A7862A0FF465879D5F‾,0.00B92143FA36F5E02E4850FE8DBD78‾]

or very long!

hex(1/1007)



These numbers are bona fide algebraic objects.

p := hex(1/4)*x^2 + hex(2/3)*x + hex(4/9)


 0.4x2+0.A‾x+0.71C‾

q := D(p, x)


 0.8x+0.A‾

g := gcd(p, q)