First, divide by , where is chosen such that . The integer part of is given by . The binary expansion of the fractional part can be determined by the following procedure.

Start by setting . To determine (the th digit of the binary expansion):

  • if . In this case, .
  • if . In this case,