/***********************************************************************************
 * Chaga string arithmetic library                                                 *
 * Copyright (C) 2026 Robert James Bruce                                           *
 *                                                                                 *
 * This file is part of the Chaga string arithmetic library.                       *
 *                                                                                 *
 * The Chaga string arithmetic library is free software: you can redistribute it   * 
 * and/or modify it under the terms of the GNU General Public License as published *
 * by the Free Software Foundation, either version 3 of the License, or (at your   *
 * option) any later version.                                                      *
 *                                                                                 *
 * The Chaga string arithmetic library is distributed in the hope that it will be  *
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public *
 * License for more details.                                                       *
 *                                                                                 *
 * You should have received a copy of the GNU General Public License               *
 * along with the Chaga compiler. If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************************/
#include "include/libchaga-packed_string_float_functions.h"
#include "include/libchaga-packed_string_integer_functions.h"
#include "include/libchaga-general_functions.h"
#include "include/libchaga-diagnostic_tools.h"




// *****************************************************************************************************
// * packed_string_float_release_memory                                                                *
// *                                                                                                   *
// * This function releases memory formerly allocated for a packed string-based floating-point number. *
// *                                                                                                   *
// * Input:  pointer to a string number                                                                *
// * Output: NULL                                                                                      *
// *****************************************************************************************************
psflt * packed_string_float_release_memory (psflt *number)
{
  psnc *temp_number_block, *temp_number_left_of_decimal, *temp_number_right_of_decimal;

  temp_number_left_of_decimal  = NULL;
  temp_number_right_of_decimal = NULL;
  if (number != NULL)
  {
    temp_number_left_of_decimal = number->left_of_decimal;
    while (temp_number_left_of_decimal != NULL)
    {
      temp_number_block = temp_number_left_of_decimal;
      temp_number_left_of_decimal = temp_number_left_of_decimal->next_number_block;
      free (temp_number_block);
    }
    temp_number_right_of_decimal = number->right_of_decimal;
    while (temp_number_right_of_decimal != NULL)
    {
      temp_number_block = temp_number_right_of_decimal;
      temp_number_right_of_decimal = temp_number_right_of_decimal->next_number_block;
      free (temp_number_block);
    }
    free (number);
  }
  return NULL;
}




psflt * packed_string_float_component_release_memory (psflt *number)
{
  psnc *temp_number_block, *temp_number_left_of_decimal, *temp_number_right_of_decimal;

  temp_number_left_of_decimal  = NULL;
  temp_number_right_of_decimal = NULL;
  if (number != NULL)
  {
    temp_number_left_of_decimal = number->left_of_decimal;
    while (temp_number_left_of_decimal != NULL)
    {
      temp_number_block = temp_number_left_of_decimal;
      temp_number_left_of_decimal = temp_number_left_of_decimal->next_number_block;
      free (temp_number_block);
    }
    temp_number_right_of_decimal = number->right_of_decimal;
    while (temp_number_right_of_decimal != NULL)
    {
      temp_number_block = temp_number_right_of_decimal;
      temp_number_right_of_decimal = temp_number_right_of_decimal->next_number_block;
      free (temp_number_block);
    }
    number->left_of_decimal = NULL;
    number->right_of_decimal = NULL;
  }
  return NULL;
}



// ******************************************************************************************************************************
// * packed_string_float_set_sign                                                                                               *
// *                                                                                                                            *
// * This subroutine adds the sign to an existing number. If no number exists, it will allocate memory to store a string float. *
// ******************************************************************************************************************************
psflt * packed_string_float_set_sign (psflt *number, enum string_number_sign sign)
{
  if (number != NULL)
  { 
    number->sign = sign;
    if (number->sign == zero)
    {
      number = packed_string_float_component_release_memory (number); // Since number being set to zero, LEFT of DECIMAL and RIGHT of DECIMAL must be free'd (and set to NULL) if pointing to anything.
    }
  }
  else
  {
    number = (psflt *) malloc(sizeof(psflt));
    if (number != NULL)
    {
      number->sign             = sign;
      number->left_of_decimal  = NULL;
      number->right_of_decimal = NULL;
    }
  }
  return number;
}




psflt * packed_string_float_initialize_to_zero (psflt *number)
{
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (number != NULL)
  {
    number = packed_string_float_component_release_memory (number);
  }
  else
  {
    number = (psflt *) malloc(sizeof(psflt));
  }
  if (number != NULL)
  {
    number->sign             = zero;
    number->status_flag      = NONE;
    number->left_of_decimal  = NULL;
    number->right_of_decimal = NULL;
  }
  return number;
}




psflt * packed_string_float_initialize_to_undefined (psflt *number)
{
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (number != NULL)
  {
    number = packed_string_float_component_release_memory (number);
  }
  else
  {
    number = (psflt *) malloc(sizeof(psflt));
  }
  if (number != NULL)
  {
    number->sign             = undefined;
    number->status_flag      = NONE;
    number->left_of_decimal  = NULL;
    number->right_of_decimal = NULL;
  }
  return number;
}




// ***************************************************************************************************************************************
// * packed_string_float_append_one_digit_left_of_decimal                                                                                *
// *                                                                                                                                     *
// * This subroutine manages PACKED string-based floating-point numbers. It appends a new digit after the current highest position digit *
// * left of the decimal point for the input packed string-based floating-point number. If a digit is added to a floating point number   *
// * beyond  the floating-point number block size, a new block is allocated and appended to the string integer as a linked list.         *
// ***************************************************************************************************************************************
psnc * packed_string_float_append_one_digit_left_of_decimal (psnc *left_of_decimal, unsigned char new_digit)
{
  psnc *temp_number_block, *temp2_number_block, *new_number_block;
  long long int i;
  unsigned packed_byte, repacked_byte, nibble_low, nibble_high;

  temp_number_block  = NULL;
  temp2_number_block = NULL;
  new_number_block   = NULL;
  if (left_of_decimal != NULL)
  {
    if (left_of_decimal->first_number_block != NULL)
    {
      if (left_of_decimal->last_number_block != NULL)
      {
        temp_number_block = left_of_decimal->last_number_block;
        if ((temp_number_block->highest_digit_position >= 0) && (temp_number_block->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          if (temp_number_block->highest_nibble_position == lo)
          {
            i = temp_number_block->highest_digit_position; 
            packed_byte = temp_number_block->packed_number_block[i];
            nibble_low  = packed_byte & 0x0f;
            nibble_high = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit
            repacked_byte = (nibble_high << 4) + nibble_low;
            temp_number_block->packed_number_block[i] = repacked_byte;
            temp_number_block->highest_nibble_position = hi;
          }
          else
          {
            if ((temp_number_block->highest_digit_position + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              temp_number_block->highest_digit_position++;
              i = temp_number_block->highest_digit_position;
              nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
              temp_number_block->packed_number_block[i] = nibble_low;
              temp_number_block->highest_nibble_position = lo;
            }
            else
            {
              nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
              new_number_block = (psnc *) malloc(sizeof(psnc));
              if (new_number_block != NULL)
              {
                for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                {
                  new_number_block->packed_number_block[i] = 0;
                }
                new_number_block->packed_number_block[0]  = nibble_low;
                new_number_block->highest_digit_position  = 0;
                new_number_block->highest_nibble_position = lo;
                new_number_block->first_number_block      = left_of_decimal;
                new_number_block->last_number_block       = new_number_block;
                new_number_block->previous_number_block   = temp_number_block;
                new_number_block->next_number_block       = NULL;
                temp_number_block->next_number_block      = new_number_block;
                temp2_number_block = left_of_decimal;
                while (temp2_number_block != NULL)
                {
                  temp2_number_block->last_number_block = new_number_block;
                  temp2_number_block = temp2_number_block->next_number_block;
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    left_of_decimal = (psnc *) malloc(sizeof(psnc));
    if (left_of_decimal != NULL)
    {
      for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
      {
        left_of_decimal->packed_number_block[i] = 0;
      }
      nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
      left_of_decimal->packed_number_block[0] = nibble_low;
      left_of_decimal->highest_digit_position = 0;
      left_of_decimal->highest_nibble_position = lo;
      left_of_decimal->first_number_block     = left_of_decimal;
      left_of_decimal->last_number_block      = left_of_decimal;
      left_of_decimal->previous_number_block  = NULL;
      left_of_decimal->next_number_block      = NULL;
    }
    else
    {
      printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_one_digit_left_of_decimal()\n");
      exit (1);
    }
  }
  return left_of_decimal;
}




// ******************************************************************************************************************************************
// * packed_string_float_append_two_digits_left_of_decimal                                                                                  *
// *                                                                                                                                        *
// * This subroutine manages string-based floating-point numbers. It appends a new digit to a packed string-based floating-point component  *
// * after the current highest position digit.                                                                                              *
// ******************************************************************************************************************************************
psnc * packed_string_float_append_two_digits_left_of_decimal (psnc *left_of_decimal_string_float_component, unsigned char new_packed_digits)
{
  psnc *temp_number_block, *temp2_number_block, *new_number_block;
  unsigned char packed_byte, repacked_byte, nibble_low, new_nibble_high, new_nibble_low;
  long long int i;

  temp_number_block  = NULL;
  temp2_number_block = NULL;
  new_number_block   = NULL;
  if (left_of_decimal_string_float_component != NULL)
  {
    if (left_of_decimal_string_float_component->first_number_block != NULL)
    {
      if (left_of_decimal_string_float_component->last_number_block != NULL)
      {
        temp_number_block = left_of_decimal_string_float_component->last_number_block;
        if ((temp_number_block->highest_digit_position >= 0) && (temp_number_block->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          if (temp_number_block->highest_nibble_position == lo)
          {
            i = temp_number_block->highest_digit_position; 
            packed_byte = temp_number_block->packed_number_block[i];
            nibble_low  = packed_byte & 0x0f;
            new_nibble_high = new_packed_digits & 0x0f;
            repacked_byte = (new_nibble_high << 4) + nibble_low;
            temp_number_block->packed_number_block[i] = repacked_byte;
            temp_number_block->highest_nibble_position = hi;
            if ((i + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              temp_number_block->highest_digit_position = temp_number_block->highest_digit_position + 1;
              i = temp_number_block->highest_digit_position;
              new_nibble_low = (new_packed_digits & 0xf0) >> 4;
              temp_number_block->packed_number_block[i] = new_nibble_low;
              temp_number_block->highest_nibble_position = lo;
            }
            else
            {
              new_number_block = (psnc *) malloc(sizeof(psnc));
              if (new_number_block != NULL)
              {
                for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                {
                  new_number_block->packed_number_block[i] = 0;
                }
                new_nibble_low = (new_packed_digits & 0xf0) >> 4;
                new_number_block->packed_number_block[0]  = new_nibble_low;
                new_number_block->highest_digit_position  = 0;
                new_number_block->highest_nibble_position = lo;
                new_number_block->first_number_block      = left_of_decimal_string_float_component;
                new_number_block->last_number_block       = new_number_block;
                new_number_block->previous_number_block   = temp_number_block;
                new_number_block->next_number_block       = NULL;
                temp_number_block->next_number_block      = new_number_block;
                temp2_number_block = left_of_decimal_string_float_component;
                while (temp2_number_block != NULL)
                {
                  temp2_number_block->last_number_block = new_number_block;
                  temp2_number_block = temp2_number_block->next_number_block;
                }
              }
              else
              {
                printf ("ERROR: malloc() failed in string_float_append_two_digits_left_of_decimal. Exiting now.\n");
                exit (EXIT_FAILURE);
              }
            }
          }
          else
          {
            if ((temp_number_block->highest_digit_position + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              temp_number_block->highest_digit_position = temp_number_block->highest_digit_position + 1;
              i = temp_number_block->highest_digit_position;
              temp_number_block->packed_number_block[i] = new_packed_digits;
              temp_number_block->highest_nibble_position = hi;
            }
            else
            {
              new_number_block = (psnc *) malloc(sizeof(psnc));
              if (new_number_block != NULL)
              {
                for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                {
                  new_number_block->packed_number_block[i] = 0;
                }
                new_number_block->packed_number_block[0]  = new_packed_digits;
                new_number_block->highest_digit_position  = 0;
                new_number_block->highest_nibble_position = hi;
                new_number_block->first_number_block      = left_of_decimal_string_float_component;
                new_number_block->last_number_block       = new_number_block;
                new_number_block->previous_number_block   = temp_number_block;
                new_number_block->next_number_block       = NULL;
                temp_number_block->next_number_block      = new_number_block;
                temp2_number_block = left_of_decimal_string_float_component;
                while (temp2_number_block != NULL)
                {
                  temp2_number_block->last_number_block = new_number_block;
                  temp2_number_block = temp2_number_block->next_number_block;
                }
              }
              else
              {
                printf ("ERROR: malloc() failed in string_float_append_two_digits_left_of_decimal. Exiting now.\n");
                exit (EXIT_FAILURE);
              }
            }
          }
        }
        else
        {
          new_number_block = (psnc *) malloc(sizeof(psnc));
          if (new_number_block != NULL)
          {
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              new_number_block->packed_number_block[i] = 0;
            }
            new_number_block->packed_number_block[0]  = new_packed_digits;
            new_number_block->highest_digit_position  = 0;
            new_number_block->highest_nibble_position = hi;
            new_number_block->first_number_block      = left_of_decimal_string_float_component;
            new_number_block->last_number_block       = new_number_block;
            new_number_block->previous_number_block   = temp_number_block;
            new_number_block->next_number_block       = NULL;
            temp_number_block->next_number_block      = new_number_block;
            temp2_number_block = left_of_decimal_string_float_component;
            while (temp2_number_block != NULL)
            {
              temp2_number_block->last_number_block = new_number_block;
              temp2_number_block = temp2_number_block->next_number_block;
            }
          }
          else
          {
            printf ("ERROR: malloc() failed in string_float_append_two_digits_left_of_decimal. Exiting now.\n");
            exit (EXIT_FAILURE);
          }
        }
      }
      else
      {
        printf ("ERROR: string_float_append_two_digits_left_of_decimal found last_number_block is NULL.\n");
        exit (EXIT_FAILURE);
      }
    }
  }
  else
  {
    left_of_decimal_string_float_component = (psnc *) malloc(sizeof(psnc));
    if (left_of_decimal_string_float_component != NULL)
    {
      for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
      {
        left_of_decimal_string_float_component->packed_number_block[i] = 0;
      }
      left_of_decimal_string_float_component->packed_number_block[0]  = new_packed_digits;
      left_of_decimal_string_float_component->highest_digit_position  = 0;
      left_of_decimal_string_float_component->highest_nibble_position = hi;
      left_of_decimal_string_float_component->first_number_block      = left_of_decimal_string_float_component;
      left_of_decimal_string_float_component->last_number_block       = left_of_decimal_string_float_component;
      left_of_decimal_string_float_component->previous_number_block   = NULL;
      left_of_decimal_string_float_component->next_number_block       = NULL;
    }
    else
    {
      printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_two_digits_left_of_decimal. Exiting now.\n");
      exit (1);
    }
  }
  return left_of_decimal_string_float_component;
}




// ********************************************************************************************************************************
// * packed_string_float_append_one_digit_right_of_decimal                                                                        *
// *                                                                                                                              *
// * This subroutine manages string-based floating-point numbers. It appends a new digit after the current highest position digit *
// * right of the decimal point in the string-based floating-point number. If a digit is added to a floating point number beyond  *
// * the floating-point number block size, then a new block is allocated and appended to the string integer as a linked list.     *
// ********************************************************************************************************************************
psnc * packed_string_float_append_one_digit_right_of_decimal (psnc *right_of_decimal, unsigned char new_digit)
{
  psnc *temp_number_block, *temp2_number_block, *new_number_block;
  long long int i;
  unsigned packed_byte, repacked_byte, nibble_low, nibble_high;

  temp_number_block  = NULL;
  temp2_number_block = NULL;
  new_number_block   = NULL;
  if (right_of_decimal != NULL)
  {
    if (right_of_decimal->first_number_block != NULL)
    {
      if (right_of_decimal->last_number_block != NULL)
      {
        temp_number_block = right_of_decimal->last_number_block;
        if ((temp_number_block->highest_digit_position >= 0) && (temp_number_block->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          if (temp_number_block->highest_nibble_position == lo)
          {
            i = temp_number_block->highest_digit_position; 
            packed_byte = temp_number_block->packed_number_block[i];
            nibble_low  = packed_byte & 0x0f;
            nibble_high = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit
            repacked_byte = (nibble_high << 4) + nibble_low;
            temp_number_block->packed_number_block[i] = repacked_byte;
            temp_number_block->highest_nibble_position = hi;
          }
          else
          {
            if ((temp_number_block->highest_digit_position + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              temp_number_block->highest_digit_position++;
              i = temp_number_block->highest_digit_position;
              nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
              temp_number_block->packed_number_block[i] = nibble_low;
              temp_number_block->highest_nibble_position = lo;
            }
            else
            {
              nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
              new_number_block = (psnc *) malloc(sizeof(psnc));
              if (new_number_block != NULL)
              {
                for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                {
                  new_number_block->packed_number_block[i] = 0;
                }
                new_number_block->packed_number_block[0]  = nibble_low;
                new_number_block->highest_digit_position  = 0;
                new_number_block->highest_nibble_position = lo;
                new_number_block->first_number_block      = right_of_decimal;
                new_number_block->last_number_block       = new_number_block;
                new_number_block->previous_number_block   = temp_number_block;
                new_number_block->next_number_block       = NULL;
                temp_number_block->next_number_block      = new_number_block;
                temp2_number_block = right_of_decimal;
                while (temp2_number_block != NULL)
                {
                  temp2_number_block->last_number_block = new_number_block;
                  temp2_number_block = temp2_number_block->next_number_block;
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    right_of_decimal = (psnc *) malloc(sizeof(psnc));
    if (right_of_decimal != NULL)
    {
      for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
      {
        right_of_decimal->packed_number_block[i] = 0;
      }
      nibble_low = new_digit & 0x0f; // remove high nibble (if any) that is present. I ONLY want the first four bits as an input digit since I'm ONLY adding ONE digit!
      right_of_decimal->packed_number_block[0] = nibble_low;
      right_of_decimal->highest_digit_position = 0;
      right_of_decimal->highest_nibble_position = lo;
      right_of_decimal->first_number_block     = right_of_decimal;
      right_of_decimal->last_number_block      = right_of_decimal;
      right_of_decimal->previous_number_block  = NULL;
      right_of_decimal->next_number_block      = NULL;
    }
    else
    {
      printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_one_digit_right_of_decimal()\n");
      exit (1);
    }
  }
  return right_of_decimal;
}




// ********************************************************************************************************************************
// * packed_string_float_append_two_digits_right_of_decimal                                                                       *
// *                                                                                                                              *
// * This subroutine manages string-based floating-point numbers. It appends TWO new digits (packed as a byte) after the current  *
// * highest position digit right of the decimal point in the string-based floating-point number. If a digit is added to a        *
// * floating point number beyond the floating-point number block size, then a new block is allocated and appended to the string  *
// * float as a linked list.                                                                                                      *
// ********************************************************************************************************************************
psnc * packed_string_float_append_two_digits_right_of_decimal (psnc *right_of_decimal, unsigned char packed_input_byte)
{
  psnc *temp_number_block, *temp2_number_block, *new_number_block;
  long long int i;
  unsigned repacked_byte, packed_byte, nibble_low, input_byte_nibble_low, input_byte_nibble_high;

  temp_number_block  = NULL;
  temp2_number_block = NULL;
  new_number_block   = NULL;
  input_byte_nibble_low  = packed_input_byte & 0x0f;
  input_byte_nibble_high = (packed_input_byte & 0xf0) >> 4;
  if (right_of_decimal != NULL)
  {
    if (right_of_decimal->first_number_block != NULL)
    {
      if (right_of_decimal->last_number_block != NULL)
      {
        temp_number_block = right_of_decimal->last_number_block;
        if ((temp_number_block->highest_digit_position >= 0) && (temp_number_block->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          if (temp_number_block->highest_nibble_position == lo)
          {
            i = temp_number_block->highest_digit_position; 
            packed_byte = temp_number_block->packed_number_block[i];
            nibble_low = packed_byte & 0x0f;
            repacked_byte = (input_byte_nibble_low << 4) + nibble_low;
            temp_number_block->packed_number_block[i] = repacked_byte;
            temp_number_block->highest_nibble_position = hi;
            if ((temp_number_block->highest_digit_position + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              temp_number_block->highest_digit_position++;
              i = temp_number_block->highest_digit_position;
              temp_number_block->packed_number_block[i] = input_byte_nibble_high;
              temp_number_block->highest_nibble_position = lo;
            }
            else
            {  
              new_number_block = (psnc *) malloc(sizeof(psnc));
              if (new_number_block != NULL)
              {
                for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                {
                  new_number_block->packed_number_block[i] = 0;
                }
                new_number_block->packed_number_block[0]  = input_byte_nibble_high;
                new_number_block->highest_digit_position  = 0;
                new_number_block->highest_nibble_position = lo;
                new_number_block->first_number_block      = right_of_decimal;
                new_number_block->last_number_block       = new_number_block;
                new_number_block->previous_number_block   = temp_number_block;
                new_number_block->next_number_block       = NULL;
                temp_number_block->next_number_block      = new_number_block;
                temp2_number_block = right_of_decimal;
                while (temp2_number_block != NULL)
                {
                  temp2_number_block->last_number_block = new_number_block;
                  temp2_number_block = temp2_number_block->next_number_block;
                }
              }
            }
          }
          else
          {
            if (temp_number_block->highest_nibble_position == hi)
            {
              if ((temp_number_block->highest_digit_position + 1) < MAX_PACKED_NUMBER_BLOCK_SIZE)
              {
                temp_number_block->highest_digit_position++;
                i = temp_number_block->highest_digit_position;
                temp_number_block->packed_number_block[i] = packed_input_byte;
                temp_number_block->highest_nibble_position = hi;
              }
              else
              {
                new_number_block = (psnc *) malloc(sizeof(psnc));
                if (new_number_block != NULL)
                {
                  for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
                  {
                    new_number_block->packed_number_block[i] = 0;
                  }
                  new_number_block->packed_number_block[0]  = packed_input_byte;
                  new_number_block->highest_digit_position  = 0;
                  new_number_block->highest_nibble_position = hi;
                  new_number_block->first_number_block      = right_of_decimal;
                  new_number_block->last_number_block       = new_number_block;
                  new_number_block->previous_number_block   = temp_number_block;
                  new_number_block->next_number_block       = NULL;
                  temp_number_block->next_number_block      = new_number_block;
                  temp2_number_block = right_of_decimal;
                  while (temp2_number_block != NULL)
                  {
                    temp2_number_block->last_number_block = new_number_block;
                    temp2_number_block = temp2_number_block->next_number_block;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  else
  {
    right_of_decimal = (psnc *) malloc(sizeof(psnc));
    if (right_of_decimal != NULL)
    {
      for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
      {
        right_of_decimal->packed_number_block[i] = 0;
      }
      right_of_decimal->packed_number_block[0]  = packed_input_byte;
      right_of_decimal->highest_digit_position  = 0;
      right_of_decimal->highest_nibble_position = hi;
      right_of_decimal->first_number_block      = right_of_decimal;
      right_of_decimal->last_number_block       = right_of_decimal;
      right_of_decimal->previous_number_block   = NULL;
      right_of_decimal->next_number_block       = NULL;
    }
    else
    {
      printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_two_digits_right_of_decimal()\n");
      exit (1);
    }
  }
  return right_of_decimal;
}





// ********************************************************************************************************************************
// * packed_string_float_append_number_block_right_of_decimal_in_stack_order                                                      *
// *                                                                                                                              *
// * This subroutine appends one entire number block to the right of the decimal for packed string-based floating-point numbers.  *
// *                                                                                                                              *
// * Normally, number blocks are appended in increasing order starting from first number block, second number block, third number *
// * block, etc. However, this subroutine appends number blocks in the reverse order: the number blocks are appended to the last  *
// * number block and grow backwards towards the first number block.                                                              *
// ********************************************************************************************************************************
psnc * packed_string_float_append_number_block_right_of_decimal_in_stack_order (psnc *right_of_decimal, unsigned char *source_number_block, int highest_digit_position, enum occupied_nibble highest_nibble_position)
{
  psnc *temp2_number_block, *new_number_block;
  int i;

  temp2_number_block = NULL;
  new_number_block   = NULL;
  if (source_number_block != NULL)
  {
    if ((highest_digit_position >= 0) && (highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
    {
      if (right_of_decimal != NULL)
      {
        new_number_block = (psnc *) malloc(sizeof(psnc));
        if (new_number_block != NULL)
        {
          for (i = 0; i <= highest_digit_position; i++)
          {
            new_number_block->packed_number_block[i] = source_number_block[i];
          }
          for (i = highest_digit_position + 1; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            new_number_block->packed_number_block[i] = 0;
          }
          new_number_block->highest_digit_position  = highest_digit_position;
          new_number_block->highest_nibble_position = highest_nibble_position;
          new_number_block->first_number_block      = new_number_block;
          new_number_block->last_number_block       = right_of_decimal->last_number_block;
          new_number_block->previous_number_block   = NULL;
          new_number_block->next_number_block       = right_of_decimal->first_number_block;
          right_of_decimal->previous_number_block   = new_number_block;
          temp2_number_block = right_of_decimal->first_number_block;
          while (temp2_number_block != NULL)
          {
            temp2_number_block->first_number_block = new_number_block;
            temp2_number_block = temp2_number_block->next_number_block;
          }
          right_of_decimal = new_number_block;
        }
        else
        {
          printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_number_block_right_of_decimal_in_stack_order(). Exiting now.\n");
          exit (EXIT_FAILURE);
        }
      }
      else
      {
        right_of_decimal = (psnc *) malloc(sizeof(psnc));
        if (right_of_decimal != NULL)
        {
          for (i = 0; i <= highest_digit_position; i++)
          {
            right_of_decimal->packed_number_block[i] = source_number_block[i];
          }
          for (i = highest_digit_position + 1; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            right_of_decimal->packed_number_block[i] = 0;
          }
          right_of_decimal->highest_digit_position  = highest_digit_position;
          right_of_decimal->highest_nibble_position = highest_nibble_position;
          right_of_decimal->first_number_block      = right_of_decimal;
          right_of_decimal->last_number_block       = right_of_decimal;
          right_of_decimal->previous_number_block   = NULL;
          right_of_decimal->next_number_block       = NULL;
        }
        else
        {
          printf ("ERROR: malloc() failed to allocate memory in packed_string_float_append_number_block_right_of_decimal_in_stack_order(). Exiting now.\n");
          exit (EXIT_FAILURE);
        }
      }
    }
  }
  return right_of_decimal;
}




// ***************************************************************************************
// * packed_string_float_copy_number                                                     *
// *                                                                                     *
// * This function makes a duplicate copy of a packed string-based float data structure. *
// *                                                                                     *
// * Input: The packed string-based float number to copy.                                *
// * Output: NULL on failure; pointer to a packed string-based float on success.         *
// ***************************************************************************************
psflt * packed_string_float_copy_number (psflt *number_copy, psflt *number)
{
  psnc *new_number_block_left_of_decimal, *number_copy_previous_left_of_decimal, *temp_num_left_of_decimal;
  psnc *new_number_block_right_of_decimal, *number_copy_previous_right_of_decimal, *temp_num_right_of_decimal;
  int state;
  unsigned char packed_digits, nibble_lo;
  long long int i;

//
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (number_copy != NULL)
  {
    number_copy = packed_string_float_component_release_memory (number_copy);
  }
  if (number != NULL)
  {
    if ((number->left_of_decimal != NULL) || (number->right_of_decimal != NULL))
    {
      if (number_copy == NULL)
      {
        number_copy = (psflt *) malloc(sizeof(psflt));
      }
      if (number_copy != NULL)
      {
        number_copy->sign = number->sign;
        number_copy->status_flag = number->status_flag;
        number_copy->left_of_decimal  = NULL;
        number_copy->right_of_decimal = NULL;
        if (number->left_of_decimal != NULL)
        {
// ********************************
// * Copy number LEFT of decimal. *
// ********************************
          new_number_block_left_of_decimal      = NULL;
          number_copy_previous_left_of_decimal  = NULL;
          state = 0;
          temp_num_left_of_decimal = number->left_of_decimal;
          while (temp_num_left_of_decimal != NULL)
          {
            new_number_block_left_of_decimal = (psnc *) malloc(sizeof(psnc));
            if (new_number_block_left_of_decimal != NULL)
            {
              new_number_block_left_of_decimal->highest_digit_position = temp_num_left_of_decimal->highest_digit_position;
              new_number_block_left_of_decimal->first_number_block     = NULL;
              new_number_block_left_of_decimal->last_number_block      = NULL;
              new_number_block_left_of_decimal->previous_number_block  = NULL;
              new_number_block_left_of_decimal->next_number_block      = NULL;
              for (i = temp_num_left_of_decimal->highest_digit_position + 1; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                new_number_block_left_of_decimal->packed_number_block[i] = 0;
              }
              for (i = 0; i < temp_num_left_of_decimal->highest_digit_position; i++)
              {
                new_number_block_left_of_decimal->packed_number_block[i] = temp_num_left_of_decimal->packed_number_block[i];
              }
              if (temp_num_left_of_decimal->highest_nibble_position == hi)
              {
                new_number_block_left_of_decimal->highest_nibble_position = hi;
                new_number_block_left_of_decimal->packed_number_block[i] = temp_num_left_of_decimal->packed_number_block[i];
              }
              else
              {
                packed_digits = temp_num_left_of_decimal->packed_number_block[i];
                nibble_lo = packed_digits & 0x0f;
                new_number_block_left_of_decimal->highest_nibble_position = lo;
                new_number_block_left_of_decimal->packed_number_block[i] = nibble_lo;
              }
              switch (state)
              {
                case 0:
                  number_copy->left_of_decimal = new_number_block_left_of_decimal;
                  number_copy->left_of_decimal->first_number_block = number_copy->left_of_decimal;
                  number_copy->left_of_decimal->previous_number_block = NULL;
                  state = 10;
                break;
                case 10:
                  if (number_copy_previous_left_of_decimal != NULL)
                  {
                    number_copy_previous_left_of_decimal->next_number_block = new_number_block_left_of_decimal;
                  }
                  new_number_block_left_of_decimal->first_number_block    = number_copy->left_of_decimal;
                  new_number_block_left_of_decimal->previous_number_block = number_copy_previous_left_of_decimal; 
                break;
                default:
                break;
              }
              number_copy_previous_left_of_decimal = new_number_block_left_of_decimal;
            }
            temp_num_left_of_decimal = temp_num_left_of_decimal->next_number_block;
          }
          if (number_copy->left_of_decimal != NULL)
          {
            if (new_number_block_left_of_decimal != NULL)
            {
              temp_num_left_of_decimal = number_copy->left_of_decimal;
              while (temp_num_left_of_decimal != NULL)
              {
                temp_num_left_of_decimal->last_number_block = new_number_block_left_of_decimal;
                temp_num_left_of_decimal = temp_num_left_of_decimal->next_number_block;
              }
            }
          }
        }
        if (number->right_of_decimal != NULL)
        {
// *********************************
// * Copy number RIGHT of decimal. *
// *********************************
          new_number_block_right_of_decimal     = NULL;
          number_copy_previous_right_of_decimal = NULL;
          state = 0;
          temp_num_right_of_decimal = number->right_of_decimal;
          while (temp_num_right_of_decimal != NULL)
          {
            new_number_block_right_of_decimal = (psnc *) malloc(sizeof(psnc));
            if (new_number_block_right_of_decimal != NULL)
            {
              new_number_block_right_of_decimal->highest_digit_position = temp_num_right_of_decimal->highest_digit_position;
              new_number_block_right_of_decimal->first_number_block     = NULL;
              new_number_block_right_of_decimal->last_number_block      = NULL;
              new_number_block_right_of_decimal->previous_number_block  = NULL;
              new_number_block_right_of_decimal->next_number_block      = NULL;
              for (i = temp_num_right_of_decimal->highest_digit_position + 1; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                new_number_block_right_of_decimal->packed_number_block[i] = 0;
              }
              for (i = 0; i < temp_num_right_of_decimal->highest_digit_position; i++)
              {
                new_number_block_right_of_decimal->packed_number_block[i] = temp_num_right_of_decimal->packed_number_block[i];
              }
              if (temp_num_right_of_decimal->highest_nibble_position == hi)
              {
                new_number_block_right_of_decimal->highest_nibble_position = hi;
                new_number_block_right_of_decimal->packed_number_block[i] = temp_num_right_of_decimal->packed_number_block[i];
              }
              else
              {
                if (temp_num_right_of_decimal->highest_nibble_position == lo)
                {
                  packed_digits = temp_num_right_of_decimal->packed_number_block[i];
                  nibble_lo = packed_digits & 0x0f;
                  new_number_block_right_of_decimal->highest_nibble_position = lo;
                  new_number_block_right_of_decimal->packed_number_block[i] = nibble_lo;
                }
              }
              switch (state)
              {
                case 0:
                  number_copy->right_of_decimal = new_number_block_right_of_decimal;
                  number_copy->right_of_decimal->first_number_block = number_copy->right_of_decimal;
                  number_copy->right_of_decimal->previous_number_block = NULL;
                  state = 10;
                break;
                case 10:
                  if (number_copy_previous_right_of_decimal != NULL)
                  {
                    number_copy_previous_right_of_decimal->next_number_block = new_number_block_right_of_decimal;
                  }
                  new_number_block_right_of_decimal->first_number_block    = number_copy->right_of_decimal;
                  new_number_block_right_of_decimal->previous_number_block = number_copy_previous_right_of_decimal; 
                break;
                default:
                break;
              }
              number_copy_previous_right_of_decimal = new_number_block_right_of_decimal;
            }
            temp_num_right_of_decimal = temp_num_right_of_decimal->next_number_block;
          }
          if (number_copy->right_of_decimal != NULL)
          {
            if (new_number_block_right_of_decimal != NULL)
            {
              temp_num_right_of_decimal = number_copy->right_of_decimal;
              while (temp_num_right_of_decimal != NULL)
              {
                temp_num_right_of_decimal->last_number_block = new_number_block_right_of_decimal;
                temp_num_right_of_decimal = temp_num_right_of_decimal->next_number_block;
              }
            }
          }
        }
      }
    }
    else
    {
      if (number->sign == zero)
      {
        number_copy = packed_string_float_initialize_to_zero (number_copy);
      }
    }
  }
  return number_copy;
}




// **************************************************************************************************************
// * packed_string_float_set_value                                                                              *
// *                                                                                                            *
// * This function loads an unsigned NULL-terminated character string (representing a floating point number)    *
// * into a packed string-based floating-point number.                                                          *
// *                                                                                                            *
// *                                                                                                            *
// * NOTE: Up to 4096 bytes may be input to this function. These bytes may include: {.,0,1,2,3,4,5,6,7,8,9,+,-} *
// **************************************************************************************************************
psflt * packed_string_float_set_value (psflt *number, char *string_value)
{
  psnc *left_of_decimal, *right_of_decimal;
  unsigned char byte, temp_byte, zero_digit_found, number_is_negative;
  unsigned char left_of_decimal_nonzero_digit_found, right_of_decimal_nonzero_digit_found, decimal_point_found;
  int done, state;
  size_t i, string_value_length;
  digit_stack_node *digit_stack, *temp_digit_stack, *temp2_digit_stack, *left_of_decimal_digit_stack;

  zero_digit_found = FALSE;
  left_of_decimal_nonzero_digit_found  = FALSE;
  right_of_decimal_nonzero_digit_found = FALSE;
  number_is_negative  = FALSE;
  decimal_point_found = FALSE;
  left_of_decimal   = NULL;
  right_of_decimal  = NULL;
  digit_stack       = NULL;
  temp_digit_stack  = NULL;
  temp2_digit_stack = NULL;
  left_of_decimal_digit_stack = NULL;
//
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (number != NULL)
  {
    number = packed_string_float_component_release_memory (number);
  }
  if (string_value != NULL)
  {
// ********************************************************************************************************************
// * Preprocess the input string to check for leading zeroes (LEFT of DECIMAL) and trailing zeros (RIGHT of DECIMAL). *
// *                                                                                                                  *
// * Examples:                                                                                                        *
// *                                                                                                                  *
// * Leading zeros LEFT of DECIMAL:     000012345.6789                                                                *
// * Trailing zeroes RIGHT of DECIMAL:  12345.67890000                                                                *
// *                                                                                                                  *
// * Leading and trailing zeroes must be removed from the input string otherwise these leading/trailing zeroes will   *
// * be added to the packed string floating point number.                                                             *
// * ******************************************************************************************************************
    string_value_length = strnlen (string_value, 4096);
    state = 0;
    i = 0;
    while ((i < string_value_length) && (state < 999))
    {
      byte = string_value[i];
      //printf ("i = %ld, byte = %c, state = %d\n", i, byte, state);
      switch (state)
      {
        case 0:
          if (byte == '0')
          {
            zero_digit_found = TRUE;
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            state = 10;
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              left_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
              state = 40;
            }
            else
            {
              if ((byte == '+') || (byte == '-'))
              {
                temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                state = 20;
              }
              else
              {
                if (byte == '.')
                {
                  temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                  state = 50;
                }
                else
                {
                  state = 999;
                }
              }
            }
          }
        break;
        case 10:
          if (byte == '0')
          {
            zero_digit_found = TRUE;
            state = 10;
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              left_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = pop_digit_stack (temp_digit_stack); // Remove the leading zero digit
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
              state = 40;
            }
            else
            {
              if (byte == '.')
              {
                temp_digit_stack = pop_digit_stack (temp_digit_stack); // Remove the leading zero digit
                temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                state = 50;
              }
              else
              {
                state = 999;
              }
            }
          }
        break;
        case 20: // Unary plus or minus already encountered now expecting only digits or a decimal point.
          if (byte == '0')
          {
            zero_digit_found = TRUE;
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            state = 30;
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              left_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
              state = 40;
            }
            else
            {
              if (byte == '.')
              {
                temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                state = 50;
              }
              else
              {
                state = 999;
              }
            }
          }
        break;
        case 30: // Unary plus or minus followed by digit zero already encountered.
          if (byte == '0')
          {
            zero_digit_found = TRUE;
            state = 30;
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              left_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = pop_digit_stack (temp_digit_stack); // Remove the zero digit on top of stack.
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
              state = 40;
            }
            else
            {
              if (byte == '.')
              {
                temp_digit_stack = pop_digit_stack (temp_digit_stack); // Remove the zero digit on top of stack.
                temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                state = 50;
              }
              else
              {
                state = 999;
              }
            }
          }
        break;
        case 40:  // Only unary operator and/or digits thus far. Expecting either a decimal or digits.
          if (byte == '0')
          {
            zero_digit_found = TRUE;
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              left_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            }
            else
            {
              if (byte == '.')
              {
                temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
                state = 50;
              }
              else
              {
                state = 999;
              }
            }
          }
        break;
        case 50: // Only expecting digits at this point.
          if (byte == '0')
          {
            temp2_digit_stack = push_digit_stack (temp2_digit_stack, byte);
            zero_digit_found = TRUE;
          }
          else
          {
            if ((byte >= '1') && (byte <= '9'))
            {
              while (temp2_digit_stack != NULL)
              {
                temp_byte = top_digit_stack (temp2_digit_stack);
                temp_digit_stack = push_digit_stack (temp_digit_stack, temp_byte);
                temp2_digit_stack = pop_digit_stack (temp2_digit_stack);
              }
              zero_digit_found = FALSE;
              right_of_decimal_nonzero_digit_found = TRUE;
              temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            }              
            else
            {
              state = 999;
            }             
          }
        break;
        default:
        break;
      }
      i++;
    }
    while (temp2_digit_stack != NULL)
    {
      temp2_digit_stack = pop_digit_stack (temp2_digit_stack);
    }
    if (state == 999)
    {
      while (temp_digit_stack != NULL)
      {
        temp_digit_stack = pop_digit_stack (temp_digit_stack);
      }  
    }
    else
    {
      done = FALSE;
      while ((temp_digit_stack != NULL) && (!done))
      {
        byte = top_digit_stack (temp_digit_stack);
        if (byte == '0') 
        {
          if (decimal_point_found)
          {
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
          else
          {
            done = TRUE;
          }
        }
        else
        {
          done = TRUE;
        }
      }
      state = 100;
      digit_stack = NULL;
      while ((temp_digit_stack != NULL) && (state < 999))
      {
        byte = top_digit_stack (temp_digit_stack);
        switch (state)
        {
          case 100:
            if (byte == '.')
            {
              digit_stack = push_digit_stack (digit_stack, byte);
              state = 110;
            }
            else
            {
              digit_stack = push_digit_stack (digit_stack, byte);
              state = 120;
            }
          break;
          case 110:
            if ((byte == '+') || (byte == '-'))
            {
              if (zero_digit_found)
              {
                digit_stack = pop_digit_stack (digit_stack); // pop the decimal - don't need it
                digit_stack = push_digit_stack (digit_stack, '0');
              }
              else
              {
                state = 999;
              }
            }
            else
            {
              digit_stack = push_digit_stack (digit_stack, byte);
              state = 120;
            }
          break;
          case 120:
            digit_stack = push_digit_stack (digit_stack, byte);
          break;
          default:
          break;
        }
        if (state < 999)
        {
          temp_digit_stack = pop_digit_stack (temp_digit_stack);
        }
      }
      if (state == 999)
      {
        while (temp_digit_stack != NULL)
        {
          temp_digit_stack = pop_digit_stack (temp_digit_stack);
        }
        while (digit_stack != NULL)
        {
          digit_stack = pop_digit_stack (digit_stack);
        }
      }
      else
      {
        left_of_decimal_digit_stack = NULL;
        state = 200;
        while ((digit_stack != NULL) && (state < 999))
        {
          byte = top_digit_stack (digit_stack);
          //printf ("state = %d, byte = %c\n", state, byte);
          switch (state)
          {
            case 200:
              if (byte == '0')
              {
                left_of_decimal_digit_stack = push_digit_stack (left_of_decimal_digit_stack, byte);
                state = 300; // We might be setting the number to zero (i.e. one zero digit). That's why I advance to state 300.
              }
              else
              {
                if ((byte >= '1') && (byte <= '9'))
                {
                  left_of_decimal_digit_stack = push_digit_stack (left_of_decimal_digit_stack, byte);
                  state = 210;
                }
                else
                {
                  if (byte == '-')
                  {
                    number_is_negative = TRUE;
                    state = 210;
                  }
                  else
                  {
                    if (byte == '+')
                    {
                      number_is_negative = FALSE;
                      state = 210;
                    }
                    else
                    {
                      if (byte == '.')
                      {
                        state = 220;
                      }
                      else
                      {
                        state = 999;
                      }
                    }
                  }
                }
              }
            break;
            case 210:
              if ((byte >= '0') && (byte <= '9'))
              {
                left_of_decimal_digit_stack = push_digit_stack (left_of_decimal_digit_stack, byte);
              }
              else
              {
                if (byte == '.')
                {
                  state = 220;
                }
              }
            break;
            case 220:
              if ((byte >= '0') && (byte <= '9'))
              {
                right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (right_of_decimal, byte);
              }
              else
              {
                state = 999;
              }
            break;
            case 300:
              if ((byte >= '1') && (byte <= '9'))
              {
                left_of_decimal_digit_stack = push_digit_stack (left_of_decimal_digit_stack, byte);
                state = 210;
              }
              else
              {
                state = 999; 
              }
            break;
            default:
            break;
          }
          digit_stack = pop_digit_stack (digit_stack);
        }
        if (state < 999)
        {
          while (left_of_decimal_digit_stack != NULL)
          {
            byte = top_digit_stack (left_of_decimal_digit_stack);
            left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (left_of_decimal, byte);
            left_of_decimal_digit_stack = pop_digit_stack (left_of_decimal_digit_stack);
          }
          if ((!left_of_decimal_nonzero_digit_found) && (!right_of_decimal_nonzero_digit_found))
          {
            number = packed_string_float_initialize_to_zero (number);
          }
          else
          {
            number = (psflt *) malloc(sizeof(psflt));
            if (number != NULL)
            {
              if (number_is_negative)
              {
                number = packed_string_float_set_sign (number, negative);
              }
              else
              {
                number = packed_string_float_set_sign (number, positive);
              }  
              number->left_of_decimal = left_of_decimal;
              number->right_of_decimal = right_of_decimal;
              number->status_flag = 0;
            }
          }
        }
      }
    }
  }
  return number;
}
  
  
 

// *************************************************************************************************************
// * packed_string_float_display displays an internal packed string-based floating-point number to the screen. *
// *************************************************************************************************************
void packed_string_float_display (psflt *number, int display_unary_plus)
{
  psnc *temp, *temp_number_component, *left_of_decimal_component; 
  enum occupied_nibble left_of_decimal_highest_nibble_position;
  unsigned char tempbyte, nibble_high, nibble_low, packed_byte;
  int state;
  long long int i;

  temp = NULL;
  if (number != NULL)
  {
    switch (number->sign)
    {
      case negative:
        putchar ('-');
      break;
      case zero:
        putchar ('0');
      break;
      case positive:
        if (display_unary_plus)
        {
          putchar ('+');
        }
      break;
      case undefined:
        printf ("undefined");
      break;
      default:
      break;
    }
    if ((number->sign == positive) || (number->sign == negative))
    {
      if (number->left_of_decimal != NULL)
      {
        state = 0;
        left_of_decimal_component = number->left_of_decimal;
        temp_number_component = left_of_decimal_component->last_number_block;
        while (temp_number_component != NULL)
        {
          left_of_decimal_highest_nibble_position = temp_number_component->highest_nibble_position;
          i = temp_number_component->highest_digit_position;
          if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
          {
            while (i >= 0)
            {
              packed_byte = temp_number_component->packed_number_block[i];
              nibble_low  = packed_byte & 0x0f;
              switch (state)
              {
                case 0:
                  if (left_of_decimal_highest_nibble_position == hi)
                  {
                    nibble_high = (packed_byte & 0xf0) >> 4;
                    if ((nibble_high >= 1) && (nibble_high <= 9))
                    {
                      tempbyte = nibble_high + '0';
                      putchar (tempbyte);
                      if ((nibble_low >= 0) && (nibble_low <= 9))
                      {
                        tempbyte = nibble_low + '0';
                        putchar (tempbyte);
                      }
                      state = 10;
                    }
                    else
                    {
                      if ((nibble_low >= 1) && (nibble_low <= 9))
                      {
                        tempbyte = nibble_low + '0';
                        putchar (tempbyte);
                        state = 10;
                      }
                      else
                      {
                        if (nibble_low == 0)
                        {
                          if (i == 0)
                          {
                            if (temp_number_component->previous_number_block == NULL)
                            {
                              tempbyte = nibble_low + '0';
                              putchar (tempbyte);
                              state = 10;
                            }
                          }
                        }
                      }
                    }
                  }
                  else
                  {
                    if ((nibble_low >= 1) && (nibble_low <= 9))
                    {
                      tempbyte = nibble_low + '0';
                      putchar (tempbyte);
                      state = 10;
                    }
                    else
                    {
                      if (nibble_low == 0)
                      {
                        if (i == 0)
                        {
                          if (temp_number_component->previous_number_block == NULL)
                          {
                            tempbyte = nibble_low + '0';
                            putchar (tempbyte);
                            state = 10;
                          }
                        }
                      }
                    }
                  }
                break;
                case 10:
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  if ((nibble_high >= 0) && (nibble_high <= 9))
                  {
                    tempbyte = nibble_high + '0';
                    putchar (tempbyte);
                  }
                  if ((nibble_low >= 0) && (nibble_low <= 9))
                  {
                    tempbyte = nibble_low + '0';
                    putchar (tempbyte);
                  } 
                break;
                default:
                break;
              }
              i--;
            }
            while (i >= 0)
            {
              packed_byte = temp_number_component->packed_number_block[i];
              nibble_high = (packed_byte & 0xf0) >> 4;
              nibble_low  = packed_byte & 0x0f;
              switch (state)
              {
                case 0:
                  if ((nibble_high >= 1) && (nibble_high <= 9))
                  {
                    tempbyte = nibble_high + '0';
                    putchar (tempbyte);
                    if ((nibble_low >= 0) && (nibble_low <= 9))
                    {
                      tempbyte = nibble_low + '0';
                      putchar (tempbyte);
                    }
                    state = 10;
                  }
                  else
                  {
                    if ((nibble_low >= 1) && (nibble_low <= 9))
                    {
                      tempbyte = nibble_high + '0';
                      putchar (tempbyte);
                      state = 10;
                    }
                    else
                    {
                      if (nibble_low == 0)
                      {
                        if (i == 0)
                        {
                          if (temp_number_component->previous_number_block == NULL)
                          {
                            tempbyte = nibble_low + '0';
                            putchar (tempbyte);
                            state = 10;
                          }
                        }
                      }
                    }
                  }
                break;
                case 10:
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  if ((nibble_high >= 0) && (nibble_high <= 9))
                  {
                    tempbyte = nibble_high + '0';
                    putchar (tempbyte);
                  }
                  if ((nibble_low >= 0) && (nibble_low <= 9))
                  {
                    tempbyte = nibble_low + '0';
                    putchar (tempbyte);
                  } 
                break;
                default:
                break;
              }
              i--;
            }
          }
          temp_number_component = temp_number_component->previous_number_block;
        }
      }
      putchar ('.');
      if (number->right_of_decimal != NULL)
      {
        state = 0;
        temp = number->right_of_decimal;
        while (temp != NULL)
        {
          if (temp->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)
          {
            i = 0;
            while (i < temp->highest_digit_position)
            {
              packed_byte = temp->packed_number_block[i];
              nibble_low  = packed_byte & 0x0f;
              nibble_high = (packed_byte & 0xf0) >> 4;
              if ((nibble_low >= 0) && (nibble_low <= 9))
              {
                state = 1;
                tempbyte = nibble_low + '0';
                putchar (tempbyte);
              }
              if ((nibble_high >= 0) && (nibble_high <= 9))
              {
                state = 1;
                tempbyte = nibble_high + '0';
                putchar (tempbyte);
              }
              i++;
            }
            packed_byte = temp->packed_number_block[i];
            nibble_low  = packed_byte & 0x0f;
            nibble_high = (packed_byte & 0xf0) >> 4;
            if (temp->next_number_block != NULL)
            {
              if ((nibble_low >= 0) && (nibble_low <= 9))
              {
                state = 1;
                tempbyte = nibble_low + '0';
                putchar (tempbyte);
              }
              if ((nibble_high >= 0) && (nibble_high <= 9))
              {
                state = 1;
                tempbyte = nibble_high + '0';
                putchar (tempbyte);
              }
            }
            else
            {
              if ((nibble_high >= 1) && (nibble_high <= 9))
              {
                if ((nibble_low >= 0) && (nibble_low <= 9))
                {
                  state = 1;
                  tempbyte = nibble_low + '0';
                  putchar (tempbyte);
                }
                tempbyte = nibble_high + '0';
                putchar (tempbyte);
              }
              else
              {
                if ((nibble_low >= 1) && (nibble_low <= 9))
                {
                  state = 1;
                  tempbyte = nibble_low + '0';
                  putchar (tempbyte);
                }
              }
            }
          }
          temp = temp->next_number_block;
        }
        if (state == 0)
        {
          putchar ('0');
        }
      }
      else
      {
        putchar ('0');
      }
// **********************************
// * Now display the exponent part. *
// **********************************
//    if (number->exponent != NULL)
//    {
//      putchar ('E');
//      packed_string_integer_display (number->exponent, 0);
//      putchar ('\n');
//    }
    }
  }
  else
  {
    printf ("UNDEFINED");
  }
}  




// ******************************************************************************************************************
// * determine_absolute_value_larger_of_two_string_floats                                                           *
// *                                                                                                                *
// * This subroutine determines which of two input packed string-based floating-point numbers is the larger number. *
// *                                                                                                                *
// * If absolute value of num1 is greater than absolute value of num2: return +1                                    *
// * If absolute value of num1 is equal to absolute value of num2:     return 0                                     *
// * If absolute value of num1 is less than absolute value of num2:    return -1                                    *
// *                                                                                                                *
// * Note: a -2 indicates an error occurred and the larger number was not determined.                               *
// ******************************************************************************************************************
int packed_string_float_determine_absolute_value_larger_of_two_floats (psflt *num1, psflt *num2)
{
  psnc *temp_num1, *temp_num2, *tempA_num1, *tempA_num2, *tempB_num2;
  int larger_number_result, num1_and_num2_are_identical_left_of_decimal, num1_and_num2_are_identical_right_of_decimal, found_digit_greater_than_zero;
  unsigned char num1_packed_byte, num2_packed_byte, num1_nibble_low, num2_nibble_low, num1_nibble_high, num2_nibble_high;
  unsigned char internal_error_occurred;
  char difference;
  long long int i, num1_num2_parity_position;

  temp_num1  = NULL;
  temp_num2  = NULL;
  tempA_num1 = NULL;
  tempA_num2 = NULL;
  tempB_num2 = NULL;
  difference = 0;
  larger_number_result = -2;
  num1_num2_parity_position = 0;
  num1_and_num2_are_identical_left_of_decimal = FALSE;
  num1_and_num2_are_identical_right_of_decimal = FALSE;
  found_digit_greater_than_zero = FALSE;
  internal_error_occurred = FALSE;
  if ((num1 != NULL) && (num2 != NULL))
  {
    if ((num1->left_of_decimal != NULL) && (num2->left_of_decimal != NULL))
    {
      tempA_num1 = num1->left_of_decimal;
      tempA_num2 = num2->left_of_decimal;
      while ((tempA_num1->next_number_block != NULL) && (tempA_num2->next_number_block != NULL))
      {
        tempA_num1 = tempA_num1->next_number_block;
        tempA_num2 = tempA_num2->next_number_block;
      } 
      if ((tempA_num1->next_number_block == NULL) && (tempA_num2->next_number_block == NULL))
      {
// *******************************************************************************
// * num1 and num2 have the same number of digit datablocks.                     *
// *                                                                             *
// * Begin at highest digit on num1 and num2 and work backwards to lowest digit. *
// *******************************************************************************
        while ((tempA_num1 != NULL) && (tempA_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
        {
// *********************************************************************************************
// * Does num1 have more digits than num2 in the last datablock? That's what I must determine. *
// *********************************************************************************************
          if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE) &&
              (tempA_num2->highest_digit_position >= 0) && (tempA_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            if (tempA_num1->highest_digit_position > tempA_num2->highest_digit_position)
            {
              num1_num2_parity_position = tempA_num2->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
              i = tempA_num1->highest_digit_position;
              num1_packed_byte = tempA_num1->packed_number_block[i];
              if (tempA_num1->highest_nibble_position == hi)
              {
                if (num1_packed_byte > 0)
                {
                  difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is shorter in digit length than num1).
                }
              }
              else
              {
                num1_nibble_low = num1_packed_byte & 0x0f;
                if (num1_nibble_low > 0)
                {
                  difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is shorter in digit length than num1).
                }
              }
              i--;
              while ((i > num1_num2_parity_position) && (difference == 0))
              {
                num1_packed_byte = tempA_num1->packed_number_block[i];
                if (num1_packed_byte > 0)
                {
                  difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is a shorter in digit length than num1).
                }
                i--;
              }                           
            }
            else
            {
              if (tempA_num1->highest_digit_position < tempA_num2->highest_digit_position)
              {
                num1_num2_parity_position = tempA_num1->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
                i = tempA_num2->highest_digit_position;
                num2_packed_byte = tempA_num2->packed_number_block[i];
                if (tempA_num2->highest_nibble_position == hi)
                {
                  if (num2_packed_byte > 0)
                  {
                    difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is shorter in digit length than num2).
                  }
                }
                else
                {
                  num2_nibble_low = num2_packed_byte & 0x0f;
                  if (num2_nibble_low > 0)
                  {
                    difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is shorter in digit length than num2).
                  }
                }
                i--;
                while ((i > num1_num2_parity_position) && (difference == 0))
                {
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  if (num2_packed_byte > 0)
                  {
                    difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is shorter in digit length than num2).
                  }
                  i--;
                }
              }
              else
              {
                if (tempA_num1->highest_digit_position == tempA_num2->highest_digit_position)
                {
                  num1_num2_parity_position = tempA_num1->highest_digit_position; 
                  i = tempA_num1->highest_digit_position;
                  num1_packed_byte = tempA_num1->packed_number_block[i];
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                  num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                  //printf ("num1_nibble_high = %d\n", num1_nibble_high);
                  //printf ("num2_nibble_high = %d\n", num2_nibble_high);
                  //printf ("num1_nibble_low  = %d\n", num1_nibble_low);
                  //printf ("num2_nibble_low  = %d\n", num2_nibble_low);
                  if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == hi))
                  {
                    difference = num1_nibble_high - num2_nibble_high;
                    if (difference == 0)
                    {
                      difference = num1_nibble_low - num2_nibble_low;
                    }
                  }
                  else
                  {
                    if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == lo))
                    {
                      if (num1_nibble_high > 0)
                      {
                        difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is one-digit shorter in digit length than num1).
                      }
                    }
                    else
                    {
                      if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == hi))
                      {
                        if (num2_nibble_high > 0)
                        {
                          difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is one-digit shorter in digit length than num2).
                        }
                      }
                      else
                      {
                        if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == lo))
                        {
                          difference = num1_nibble_low - num2_nibble_low;
                        }
                        else
                        {
                          internal_error_occurred = TRUE;
                        }
                      }
                    }
                  }
                }  
              }
            }
            if (!internal_error_occurred)
            {
              i = num1_num2_parity_position - 1;
              while ((i >= 0) && (difference == 0))
              {
                num1_packed_byte = tempA_num1->packed_number_block[i];
                num2_packed_byte = tempA_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference = num1_nibble_high - num2_nibble_high;
                if (difference == 0)
                {
                  difference = num1_nibble_low - num2_nibble_low;
                }
                i--;
              }
            }
          }
          else
          {
            internal_error_occurred = TRUE;
          }
          tempA_num1 = tempA_num1->previous_number_block;
          tempA_num2 = tempA_num2->previous_number_block;
        } 
      }
      else
      {
        if (tempA_num1->next_number_block != NULL)
        {
// *********************************************************************************
// * num1 has more digit datablocks than num2                                      *
// *                                                                               *
// * Verify that at least one digit in num1's highest datablock is greater than 0. *
// *********************************************************************************
          tempA_num1 = num1->left_of_decimal->last_number_block;
          while ((tempA_num1 != tempB_num2) && (tempA_num1 != NULL) && (difference == 0) && (!internal_error_occurred))
          {
            if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              i = tempA_num1->highest_digit_position;
              while ((i >= 0) && (!found_digit_greater_than_zero))
              {
// ***********************************************************************************************************
// * We do not need to unpack the packed_byte into a high and low nibble (to extract two BCD digits). Why?   *
// * Simply because if the packed_byte is greater than zero, we know for a fact that either the high nibble, *
// * low nibble, or both nibbles contains a non-zero digit. That alone means num1 is PHYSICALLY GREATER than *
// * num2.                                                                                                   *
// ***********************************************************************************************************
                num1_packed_byte = tempA_num1->packed_number_block[i];
                if (num1_packed_byte > 0)
                {
                  found_digit_greater_than_zero = TRUE;
                  difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is shorter in digit length than num1).
                }
                i--;
              }
            }
            else
            {
              internal_error_occurred = TRUE;
            }
            tempA_num1 = tempA_num1->previous_number_block;
          }
          while ((tempA_num1 != NULL) && (tempA_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
          {
            if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE) &&
                (tempA_num2->highest_digit_position >= 0) && (tempA_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              if (tempA_num1->highest_digit_position > tempA_num2->highest_digit_position)
              {
                num1_num2_parity_position = tempA_num2->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
                i = tempA_num1->highest_digit_position;
                num1_packed_byte = tempA_num1->packed_number_block[i];
                if (tempA_num1->highest_nibble_position == hi)
                {
                  if (num1_packed_byte > 0)
                  {
                    difference = 1; // This indicates that num1 is greater than num2
                  }
                }
                else
                {
                  num1_nibble_low = num1_packed_byte & 0x0f;
                  if (num1_nibble_low > 0)
                  {
                    difference = 1; // This indicates that num1 is greater than num2
                  }
                }
                i--;
                while ((i > num1_num2_parity_position) && (difference == 0))
                {
                  num1_packed_byte = tempA_num1->packed_number_block[i];
                  if (num1_packed_byte > 0)
                  {
                    difference = 1; // This indicates that num1 is greater than num2
                  }
                  i--;
                }                           
              }
              else
              {
                if (tempA_num1->highest_digit_position < tempA_num2->highest_digit_position)
                {
                  num1_num2_parity_position = tempA_num1->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
                  i = tempA_num2->highest_digit_position;
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  if (tempA_num2->highest_nibble_position == hi)
                  {
                    if (num2_packed_byte > 0)
                    {
                      difference = -1; // This indicates that num2 is greater than num1
                    }
                  }
                  else
                  {
                    num2_nibble_low = num2_packed_byte & 0x0f;
                    if (num2_nibble_low > 0)
                    {
                      difference = -1; // This indicates that num2 is greater than num1
                    }
                  }
                  i--;
                  while ((i > num1_num2_parity_position) && (difference == 0))
                  {
                    num2_packed_byte = tempA_num2->packed_number_block[i];
                    if (num2_packed_byte > 0)
                    {
                      difference = -1; // This indicates that num2 is greater than num1
                    }
                    i--;
                  }
                }
                else
                {
                  if (tempA_num1->highest_digit_position == tempA_num2->highest_digit_position)
                  {
                    i = tempA_num1->highest_digit_position;
                    num1_packed_byte = tempA_num1->packed_number_block[i];
                    num2_packed_byte = tempA_num2->packed_number_block[i];
                    num1_nibble_low  = num1_packed_byte & 0x0f;
                    num2_nibble_low  = num2_packed_byte & 0x0f;
                    num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                    num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                    //printf ("num1_nibble_high = %d\n", num1_nibble_high);
                    //printf ("num2_nibble_high = %d\n", num2_nibble_high);
                    //printf ("num1_nibble_low  = %d\n", num1_nibble_low);
                    //printf ("num2_nibble_low  = %d\n", num2_nibble_low);
                    if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == hi))
                    {
                      difference = num1_nibble_high - num2_nibble_high;
                      if (difference == 0)
                      {
                        difference = num1_nibble_low - num2_nibble_low;
                      }
                    }
                    else
                    {
                      if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == lo))
                      {
                        if (num1_nibble_high > 0)
                        {
                          difference = 1; // This indicates that num1 is greater than num2
                        }
                      }
                      else
                      {
                        if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == hi))
                        {
                          if (num2_nibble_high > 0)
                          {
                            difference = -1; // This indicates that num2 is greater than num1
                          }
                        }
                        else
                        {
                          if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == lo))
                          {
                            difference = num1_nibble_low - num2_nibble_low;
                          }
                          else
                          {
                            internal_error_occurred = TRUE;
                          }
                        }
                      }
                    }
                  }  
                }
              }
              if (!internal_error_occurred)
              {
                i = num1_num2_parity_position - 1;
                while ((i >= 0) && (difference == 0))
                {
                  num1_packed_byte = tempA_num1->packed_number_block[i];
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                  num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                  difference = num1_nibble_high - num2_nibble_high;
                  if (difference == 0)
                  {
                    difference = num1_nibble_low - num2_nibble_low;
                  }
                  i--;
                }
              }
            }
            else
            {
              internal_error_occurred = TRUE;
            }
            tempA_num1 = tempA_num1->previous_number_block;
            tempA_num2 = tempA_num2->previous_number_block;
          } 
        }
        else
        {
          if (tempA_num2->next_number_block != NULL)
          {
// *********************************************************************************
// * num2 has more digit datablocks than num1.                                     *
// *                                                                               *
// * Verify that at least one digit in num2's highest datablock is greater than 0. *
// *********************************************************************************
            tempB_num2 = num2->left_of_decimal->last_number_block;
            while ((tempB_num2 != tempA_num2) && (tempB_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
            {
              if ((tempB_num2->highest_digit_position >= 0) && (tempB_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
              {
                i = tempB_num2->highest_digit_position;
                while ((i >= 0) && (!found_digit_greater_than_zero))
                {
// ***********************************************************************************************************
// * We do not need to unpack the packed_byte into a high and low nibble (to extract two BCD digits). Why?   *
// * Simply because if the packed_byte is greater than zero, we know for a fact that either the high nibble, *
// * low nibble, or both nibbles contains a non-zero digit. That alone means num2 is PHYSICALLY GREATER than *
// * num1.                                                                                                   *
// ***********************************************************************************************************
                  num2_packed_byte = tempB_num2->packed_number_block[i];
                  if (num2_packed_byte > 0)
                  {
                    found_digit_greater_than_zero = TRUE;
                    difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is shorter in digit length than num2).
                  }
                  i--;
                }
              }
              else
              {
                internal_error_occurred = TRUE;
              }
              tempB_num2 = tempB_num2->previous_number_block;
            }
            while ((tempA_num1 != NULL) && (tempA_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
            {
              if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE) &&
                  (tempA_num2->highest_digit_position >= 0) && (tempA_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
              {
                if (tempA_num1->highest_digit_position > tempA_num2->highest_digit_position)
                {
                  num1_num2_parity_position = tempA_num2->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
                  i = tempA_num1->highest_digit_position;
                  num1_packed_byte = tempA_num1->packed_number_block[i];
                  if (tempA_num1->highest_nibble_position == hi)
                  {
                    if (num1_packed_byte > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num2
                    }
                  }
                  else
                  {
                    num1_nibble_low = num1_packed_byte & 0x0f;
                    if (num1_nibble_low > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num2
                    }
                  }
                  i--;
                  while ((i > num1_num2_parity_position) && (difference == 0))
                  {
                    num1_packed_byte = tempA_num1->packed_number_block[i];
                    if (num1_packed_byte > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num2
                    }
                    i--;
                  }                           
                }
                else
                {
                  if (tempA_num1->highest_digit_position < tempA_num2->highest_digit_position)
                  {
                    num1_num2_parity_position = tempA_num1->highest_digit_position; // This position is where both num1 and num2 have digits that can be compared.
                    i = tempA_num2->highest_digit_position;
                    num2_packed_byte = tempA_num2->packed_number_block[i];
                    if (tempA_num2->highest_nibble_position == hi)
                    {
                      if (num2_packed_byte > 0)
                      {
                        difference = -1; // This indicates that num2 is greater than num1
                      }
                    }
                    else
                    {
                      num2_nibble_low = num2_packed_byte & 0x0f;
                      if (num2_nibble_low > 0)
                      {
                        difference = -1; // This indicates that num2 is greater than num1
                      }
                    }
                    i--;
                    while ((i > num1_num2_parity_position) && (difference == 0))
                    {
                      num2_packed_byte = tempA_num2->packed_number_block[i];
                      if (num2_packed_byte > 0)
                      {
                        difference = -1; // This indicates that num2 is greater than num1
                      }
                      i--;
                    }
                  }
                  else
                  {
                    if (tempA_num1->highest_digit_position == tempA_num2->highest_digit_position)
                    {
                      i = tempA_num1->highest_digit_position;
                      num1_packed_byte = tempA_num1->packed_number_block[i];
                      num2_packed_byte = tempA_num2->packed_number_block[i];
                      num1_nibble_low  = num1_packed_byte & 0x0f;
                      num2_nibble_low  = num2_packed_byte & 0x0f;
                      num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                      num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                      //printf ("num1_nibble_high = %d\n", num1_nibble_high);
                      //printf ("num2_nibble_high = %d\n", num2_nibble_high);
                      //printf ("num1_nibble_low  = %d\n", num1_nibble_low);
                      //printf ("num2_nibble_low  = %d\n", num2_nibble_low);
                      if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == hi))
                      {
                        difference = num1_nibble_high - num2_nibble_high;
                        if (difference == 0)
                        {
                          difference = num1_nibble_low - num2_nibble_low;
                        }
                      }
                      else
                      {
                        if ((tempA_num1->highest_nibble_position == hi) && (tempA_num2->highest_nibble_position == lo))
                        {
                          if (num1_nibble_high > 0)
                          {
                            difference = 1; // This indicates that num1 is greater than num2
                          }
                        }
                        else
                        {
                          if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == hi))
                          {
                            if (num2_nibble_high > 0)
                            {
                              difference = -1; // This indicates that num2 is greater than num1
                            }
                          }
                          else
                          {
                            if ((tempA_num1->highest_nibble_position == lo) && (tempA_num2->highest_nibble_position == lo))
                            {
                              difference = num1_nibble_low - num2_nibble_low;
                            }
                            else
                            {
                              internal_error_occurred = TRUE;
                            }
                          }
                        }
                      }
                    }  
                  }
                }
                if (!internal_error_occurred)
                {
                  i = num1_num2_parity_position - 1;
                  while ((i >= 0) && (difference == 0))
                  {
                    num1_packed_byte = tempA_num1->packed_number_block[i];
                    num2_packed_byte = tempA_num2->packed_number_block[i];
                    num1_nibble_low  = num1_packed_byte & 0x0f;
                    num2_nibble_low  = num2_packed_byte & 0x0f;
                    num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                    num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                    difference = num1_nibble_high - num2_nibble_high;
                    if (difference == 0)
                    {
                      difference = num1_nibble_low - num2_nibble_low;
                    }
                    i--;
                  }
                }
              }
              else
              {
                internal_error_occurred = TRUE;
              }
              tempA_num1 = tempA_num1->previous_number_block;
              tempA_num2 = tempA_num2->previous_number_block;
            } 
          }
        }
      }
    }
    else
    {
// *************************************************************************************************************
// * For comparison logic, if num1->left_of_decimal is NULL, I evaluate this as num1->left_of_decimal is zero. *
// * For comparison logic, if num2->left_of_decimal is NULL, I evaluate this as num2->left_of_decimal is zero. *
// *************************************************************************************************************
      if ((num1->left_of_decimal == NULL) && (num2->left_of_decimal == NULL))
      {
        num1_and_num2_are_identical_left_of_decimal = TRUE;
      }
      else
      {
        if ((num1->left_of_decimal == NULL) && (num2->left_of_decimal != NULL))
        {
// ********************************************************************
// * Need to determine if num2->left_of_decimal is greater than zero. *            
// ********************************************************************
          tempA_num2 = num2->left_of_decimal;
          while ((tempA_num2 != NULL) && (difference == 0))
          {
            if ((tempA_num2->highest_digit_position >= 0) && (tempA_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)) 
            {
              i = 0;
              while ((i < tempA_num2->highest_digit_position) && (difference == 0))
              {
                num2_packed_byte = tempA_num2->packed_number_block[i];
                if (num2_packed_byte > 0)
                {
                  difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->left_of_decimal is NULL.
                }
                i++;
              }
              if (difference == 0)
              {
                if (tempA_num2->highest_nibble_position == hi)
                {
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  if (num2_packed_byte > 0)
                  {
                    difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->left_of_decimal is NULL.
                  }
                }
                else
                { 
                  num2_packed_byte = tempA_num2->packed_number_block[i];
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  if (num2_nibble_low > 0)
                  {
                    difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->left_of_decimal is NULL.
                  }
                }
              }
            }
            tempA_num2 = tempA_num2->next_number_block;
          } 
        }
        else
        {   
          if ((num1->left_of_decimal != NULL) && (num2->left_of_decimal == NULL))
          {
// ********************************************************************
// * Need to determine if num1->left_of_decimal is greater than zero. *            
// ********************************************************************
            tempA_num1 = num1->left_of_decimal;
            while ((tempA_num1 != NULL) && (difference == 0))
            {
              if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)) 
              {
                i = 0;
                while ((i < tempA_num1->highest_digit_position) && (difference == 0))
                {
                  num1_packed_byte = tempA_num1->packed_number_block[i];
                  if (num1_packed_byte > 0)
                  {
                    difference = 1; // This indicates that num1 is greater than num2. Reminder than num2 is evaluated as zero since num2->left_of_decimal is NULL.
                  }
                  i++;
                }
                if (difference == 0)
                {
                  if (tempA_num1->highest_nibble_position == hi)
                  {
                    num1_packed_byte = tempA_num1->packed_number_block[i];
                    if (num1_packed_byte > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num2. Reminder than num2 is evaluated as zero since num2->left_of_decimal is NULL.
                    }
                  }
                  else
                  { 
                    num1_packed_byte = tempA_num1->packed_number_block[i];
                    num1_nibble_low  = num1_packed_byte & 0x0f;
                    if (num1_nibble_low > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num1. Reminder than num1 is evaluated as zero since num1->left_of_decimal is NULL.
                    }
                  }
                }
              }
              tempA_num1 = tempA_num1->next_number_block;
            }
          } 
        }
      }
    }
    if (!internal_error_occurred)
    {
      if (difference > 0)
      {
        larger_number_result = 1; // num1 is greater than num2
      }
      else
      {
        if (difference < 0)
        {
          larger_number_result = -1; // num1 is less than num2
        }
        else
        {
          num1_and_num2_are_identical_left_of_decimal = TRUE;
        }
      }
      if (num1_and_num2_are_identical_left_of_decimal)
      {
        if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal != NULL))
        {
          temp_num1 = num1->right_of_decimal;
          temp_num2 = num2->right_of_decimal;
          while ((temp_num1 != NULL) && (temp_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
          {
            if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE) &&
                (temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              i = 0;
              while ((i < temp_num1->highest_digit_position) && (i < temp_num2->highest_digit_position) && (difference == 0))
              {
                num1_packed_byte = temp_num1->packed_number_block[i];
                num2_packed_byte = temp_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                //printf ("num1_nibble_high = %d\n", num1_nibble_high);
                //printf ("num2_nibble_high = %d\n", num2_nibble_high);
                //printf ("num1_nibble_low  = %d\n", num1_nibble_low);
                //printf ("num2_nibble_low  = %d\n", num2_nibble_low);
                difference = num1_nibble_high - num2_nibble_high;
                if (difference == 0)
                {
                  difference = num1_nibble_low - num2_nibble_low;
                }
                i++;
              }  
              if (difference == 0)
              {
                num1_packed_byte = temp_num1->packed_number_block[i];
                num2_packed_byte = temp_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                //printf ("num1_nibble_high = %d\n", num1_nibble_high);
                //printf ("num2_nibble_high = %d\n", num2_nibble_high);
                //printf ("num1_nibble_low  = %d\n", num1_nibble_low);
                //printf ("num2_nibble_low  = %d\n", num2_nibble_low);
                if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == hi))
                {
                  difference = num1_nibble_high - num2_nibble_high;
                  if (difference == 0)
                  {
                    difference = num1_nibble_low - num2_nibble_low;
                  }
                }
                else
                {
                  if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == lo))
                  {
                    if (num1_nibble_high > 0)
                    {
                      difference = 1; // This indicates that num1 is greater than num2
                    }
                  }
                  else
                  {
                    if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == hi))
                    {
                      if (num2_nibble_high > 0)
                      {
                        difference = -1; // This indicates that num2 is greater than num1
                      }
                    }
                    else
                    {
                      if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == lo))
                      {
                        difference = num1_nibble_low - num2_nibble_low;
                      }
                      else
                      {
                        internal_error_occurred = TRUE;
                      }
                    }
                  }
                }
              }
            }
            else
            {
              internal_error_occurred = TRUE;
            }
            temp_num1 = temp_num1->next_number_block;
            temp_num2 = temp_num2->next_number_block;
          } 
          if (temp_num1 != NULL)
          {
// *************************************************************************
// * num1 has more digit datablocks than num2                              *
// *                                                                       *
// * Verify that at least one digit in num1's datablock is greater than 0. *
// *************************************************************************
            while ((temp_num1 != NULL) && (difference == 0) && (!internal_error_occurred))
            {
              if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
              {
                i = temp_num1->highest_digit_position;
                while ((i >= 0) && (!found_digit_greater_than_zero))
                {
// ***********************************************************************************************************
// * We do not need to unpack the packed_byte into a high and low nibble (to extract two BCD digits). Why?   *
// * Simply because if the packed_byte is greater than zero, we know for a fact that either the high nibble, *
// * low nibble, or both nibbles contains a non-zero digit. That alone means num1 is PHYSICALLY GREATER than *
// * num2.                                                                                                   *
// ***********************************************************************************************************
                  num1_packed_byte = temp_num1->packed_number_block[i];
                  if (num1_packed_byte > 0)
                  {
                    found_digit_greater_than_zero = TRUE;
                    difference = 1; // This indicates that num1 is greater than num2 since num2 does not have digits at this length (num2 is shorter in digit length than num1).
                  }
                  i--;
                }
              }
              else
              {
                internal_error_occurred = TRUE;
              }
              temp_num1 = temp_num1->next_number_block;
            }
          }
          else
          {
            if (temp_num2 != NULL)
            {
// ************************************************************************************
// * num2 has more digit datablocks than num1.                                        *
// *                                                                                  *
// * Verify that at least one digit in num2's remaining datablocks is greater than 0. *
// ************************************************************************************
              while ((temp_num2 != NULL) && (difference == 0) && (!internal_error_occurred))
              {
                if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
                {
                  i = temp_num2->highest_digit_position;
                  while ((i >= 0) && (!found_digit_greater_than_zero))
                  {
// ***********************************************************************************************************
// * We do not need to unpack the packed_byte into a high and low nibble (to extract two BCD digits). Why?   *
// * Simply because if the packed_byte is greater than zero, we know for a fact that either the high nibble, *
// * low nibble, or both nibbles contains a non-zero digit. That alone means num2 is PHYSICALLY GREATER than *
// * num1.                                                                                                   *
// ***********************************************************************************************************
                    num2_packed_byte = temp_num2->packed_number_block[i];
                    if (num2_packed_byte > 0)
                    {
                      found_digit_greater_than_zero = TRUE;
                      difference = -1; // This indicates that num2 is greater than num1 since num1 does not have digits at this length (num1 is shorter in digit length than num2).
                    }
                    i--;
                  }
                }
                else
                {
                  internal_error_occurred = TRUE;
                }
                temp_num2 = temp_num2->next_number_block;
              }
            }
          }
        }
        else
        {
// ***************************************************************************************************************
// * For comparison logic, if num1->right_of_decimal is NULL, I evaluate this as num1->right_of_decimal is zero. *
// * For comparison logic, if num2->right_of_decimal is NULL, I evaluate this as num2->right_of_decimal is zero. *
// ***************************************************************************************************************
          if ((num1->right_of_decimal == NULL) && (num2->right_of_decimal == NULL))
          {
            num1_and_num2_are_identical_right_of_decimal = TRUE;
          }
          else
          {
            if ((num1->right_of_decimal == NULL) && (num2->right_of_decimal != NULL))
            {
// ********************************************************************
// * Need to determine if num2->right_of_decimal is greater than zero. *            
// ********************************************************************
              tempA_num2 = num2->right_of_decimal;
              while ((tempA_num2 != NULL) && (difference == 0))
              {
                if ((tempA_num2->highest_digit_position >= 0) && (tempA_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)) 
                {
                  i = 0;
                  while ((i < tempA_num2->highest_digit_position) && (difference == 0))
                  {
                    num2_packed_byte = tempA_num2->packed_number_block[i];
                    if (num2_packed_byte > 0)
                    {
                      difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->right_of_decimal is NULL.
                    }
                    i++;
                  }
                  if (difference == 0)
                  {
                    if (tempA_num2->highest_nibble_position == hi)
                    {
                      num2_packed_byte = tempA_num2->packed_number_block[i];
                      if (num2_packed_byte > 0)
                      {
                        difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->right_of_decimal is NULL.
                      }
                    }
                    else
                    { 
                      num2_packed_byte = tempA_num2->packed_number_block[i];
                      num2_nibble_low  = num2_packed_byte & 0x0f;
                      if (num2_nibble_low > 0)
                      {
                        difference = -1; // This indicates that num1 is less than num2. Reminder than num1 is evaluated as zero since num1->right_of_decimal is NULL.
                      }
                    }
                  }
                }
                tempA_num2 = tempA_num2->next_number_block;
              } 
            }
            else
            {   
              if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal == NULL))
              {
// ********************************************************************
// * Need to determine if num1->right_of_decimal is greater than zero. *            
// ********************************************************************
                tempA_num1 = num1->right_of_decimal;
                while ((tempA_num1 != NULL) && (difference == 0))
                {
                  if ((tempA_num1->highest_digit_position >= 0) && (tempA_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)) 
                  {
                    i = 0;
                    while ((i < tempA_num1->highest_digit_position) && (difference == 0))
                    {
                      num1_packed_byte = tempA_num1->packed_number_block[i];
                      if (num1_packed_byte > 0)
                      {
                        difference = 1; // This indicates that num1 is greater than num2. Reminder than num2 is evaluated as zero since num2->right_of_decimal is NULL.
                      }
                      i++;
                    }
                    if (difference == 0)
                    {
                      if (tempA_num1->highest_nibble_position == hi)
                      {
                        num1_packed_byte = tempA_num1->packed_number_block[i];
                        if (num1_packed_byte > 0)
                        {
                          difference = 1; // This indicates that num1 is greater than num2. Reminder than num2 is evaluated as zero since num2->right_of_decimal is NULL.
                        }
                      }
                      else
                      { 
                        num1_packed_byte = tempA_num1->packed_number_block[i];
                        num1_nibble_low  = num1_packed_byte & 0x0f;
                        if (num1_nibble_low > 0)
                        {
                          difference = 1; // This indicates that num1 is greater than num1. Reminder than num1 is evaluated as zero since num1->right_of_decimal is NULL.
                        }
                      }
                    }
                  }
                  tempA_num1 = tempA_num1->next_number_block;
                } 
              }
            }
          }
        }
      }
    }
    if (!internal_error_occurred)
    {
      if (difference > 0)
      {
        larger_number_result = 1; // num1 is greater than num2
      }
      else
      {
        if (difference < 0)
        {
          larger_number_result = -1; // num1 is less than num2
        }
        else
        {
          num1_and_num2_are_identical_right_of_decimal = TRUE;
        }
      }
    }
  }
  else
  {
    internal_error_occurred = TRUE;
  }
  if ((num1_and_num2_are_identical_left_of_decimal) && (num1_and_num2_are_identical_right_of_decimal))
  {
    larger_number_result = 0;
  }
  return larger_number_result;
}




// ************************************************************************************************************************************************************************
// * copy_packed_string_float_digits_into_packed_string_integer                                                                                                           *
// *                                                                                                                                                                      *
// * This is an unusual subroutine in that it copies all digits linearly from least sigificant digit RIGHT of decimal to most significant digit LEFT of decimal.          *
// *                                                                                                                                                                      *
// * This subroutine is NOT a float to integer conversion program. Instead, this function is used internally for string-based floating point multiplication and division. *
// * By converting two stringfloat numbers into a series of digits packed into a stringint data structure, I can then pass the two stringints into a multiply function.   *
// * Once the multiply function is completed, I can then convert the result back into a stringfloat by chopping the stringint (multiplication result) series of digits    *
// * at the appropriate number of decimal positions.                                                                                                                      *
// ************************************************************************************************************************************************************************
psint * copy_packed_string_float_digits_into_packed_string_integer (psint *converted_result, psflt *input_number)
{
  psnc *temp_right_of_decimal, *temp_left_of_decimal;
  unsigned char packed_byte, repacked_byte, nibble_low, nibble_high;
  unsigned char digit, done;
  long long int i;
  digit_stack_node *digit_stack, *temp_digit_stack;

  digit_stack = NULL;
  temp_digit_stack = NULL;
  if (converted_result != NULL)
  {
    converted_result = packed_string_integer_component_release_memory (converted_result);
  }
  if (input_number != NULL)
  {
    if ((input_number->sign == positive) || (input_number->sign == negative))
    {
      if (converted_result == NULL)
      {
        converted_result = (psint *) malloc(sizeof(psint));
      }
      if (converted_result != NULL)
      {
        converted_result->sign             = input_number->sign;
        converted_result->status_flag      = 0;
        converted_result->left_of_decimal  = NULL;
        if (input_number->right_of_decimal != NULL)
        {
          if (input_number->left_of_decimal != NULL)
          {
// **************************************************************************************************
// * NOTE: Checking if LEFT of DECIMAL is NULL is critical. If there are no LEFT of DECIMAL digits, *
// * then a zero in the most significant place RIGHT OF DECIMAL should be ignored when it is        *
// * converted to an integer.                                                                       *
// *                                                                                                *
// * EXAMPLE A: 1.000123 : converted to integer becomes 1000123                                     *
// * EXAMPLE B: 0.000123 : converted to integer becomes     123 (rather than 000123)                *
// **************************************************************************************************
            temp_right_of_decimal = input_number->right_of_decimal->last_number_block;
            while (temp_right_of_decimal != NULL)
            {
              if ((temp_right_of_decimal->highest_digit_position >= 0) && (temp_right_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
              {
                i = temp_right_of_decimal->highest_digit_position;
                if (temp_right_of_decimal->highest_nibble_position == hi)
                {
                  packed_byte = temp_right_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  //printf ("nibble_high = %x\n", nibble_high);
                  //printf ("nibble_low  = %x\n", nibble_low);
                  repacked_byte = (nibble_low << 4) + nibble_high; // Yes, the bytes are reversed. This is because the byte ordering is backwards when traversing RIGHT of decimal compared to LEFT of decimal.
                  converted_result = packed_string_integer_append_two_digits (converted_result, repacked_byte);
                }  
                else
                {
                  packed_byte = temp_right_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  //printf ("nibble_low  = %x\n", nibble_low);
                  converted_result = packed_string_integer_append_one_digit (converted_result, nibble_low);
                }
                i--;
                while (i >= 0)
                {
                  packed_byte = temp_right_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  //printf ("nibble_high = %x\n", nibble_high);
                  //printf ("nibble_low  = %x\n", nibble_low);
                  repacked_byte = (nibble_low << 4) + nibble_high; // Yes, the bytes are reversed. This is because the byte ordering is backwards when traversing RIGHT of decimal compared to LEFT of decimal.
                  converted_result = packed_string_integer_append_two_digits (converted_result, repacked_byte);
                  i--;
                }
              }
              temp_right_of_decimal = temp_right_of_decimal->previous_number_block;
            }
          }
          else
          {
// ***********************************************************************************************
// * Since LEFT of DECIMAL is NULL, there are no digits LEFT of DECIMAL, therefore ignore        *
// * leading zeros RIGHT of DECIMAL starting at most significant digit until a non-zero digit is *
// * found.                                                                                      *
// *                                                                                             *
// * EXAMPLE: 0.000123 : converted to integer becomes 123                                        *
// ***********************************************************************************************
            temp_right_of_decimal = input_number->right_of_decimal->last_number_block;
            while (temp_right_of_decimal != NULL)
            {
              if ((temp_right_of_decimal->highest_digit_position >= 0) && (temp_right_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
              {
                i = temp_right_of_decimal->highest_digit_position;
                packed_byte = temp_right_of_decimal->packed_number_block[i];
                nibble_low  = (packed_byte & 0x0f) + '0';
                nibble_high = ((packed_byte & 0xf0) >> 4) + '0';
                if (temp_right_of_decimal->highest_nibble_position == hi)
                {
                  temp_digit_stack = push_digit_stack (temp_digit_stack, nibble_high);
                  temp_digit_stack = push_digit_stack (temp_digit_stack, nibble_low);
                }
                else
                {
                  if (temp_right_of_decimal->highest_nibble_position == lo)
                  {
                    temp_digit_stack = push_digit_stack (temp_digit_stack, nibble_low);
                  }
                  else
                  {
                    printf ("Error in copy_packed_string_float_digits_into_packed_string_integer(): temp_right_of_decimal->highest_nibble_position is undefined. Exiting now.\n");
                    exit (EXIT_FAILURE);
                  }
                }
                i--;
                while (i >= 0)
                {
                  packed_byte = temp_right_of_decimal->packed_number_block[i];
                  nibble_low  = (packed_byte & 0x0f) + '0';
                  nibble_high = ((packed_byte & 0xf0) >> 4) + '0';
                  temp_digit_stack = push_digit_stack (temp_digit_stack, nibble_high);
                  temp_digit_stack = push_digit_stack (temp_digit_stack, nibble_low);
                  i--;
                }
              }
              else
              {
                printf ("Error in copy_packed_string_float_digits_into_packed_string_integer(): temp_right_of_decimal->highest_digit_position is greater than MAX_PACKED_NUMBER_BLOCK_SIZE or is negative. Exiting now.\n");
                exit (EXIT_FAILURE);
              }
              temp_right_of_decimal = temp_right_of_decimal->previous_number_block;
            }
// ****************************************************************************
// * Remove any zeros in the most significant digit section RIGHT of DECIMAL. *
// ****************************************************************************
            done = FALSE;
            while ((temp_digit_stack != NULL) && (!done))
            {
              digit = top_digit_stack (temp_digit_stack);
              if (digit > '0')
              {
                done = TRUE;
              }
              else
              {
                temp_digit_stack = pop_digit_stack (temp_digit_stack);
              }
            }
// ***************************************************************************
// * Now copy the remaining digits to separate stack to reverse the ordering *
// ***************************************************************************
            while (temp_digit_stack != NULL)
            {
              digit = top_digit_stack (temp_digit_stack);
              digit_stack = push_digit_stack (digit_stack, digit);
              temp_digit_stack = pop_digit_stack (temp_digit_stack);
            }
// *************************************************************************************
// * Lastly, pop the stack digits (now in correct order) into converted number result. *
// *************************************************************************************
            while (digit_stack != NULL)
            {
              digit = top_digit_stack (digit_stack);
              digit = digit - '0';
              converted_result = packed_string_integer_append_one_digit (converted_result, digit);
              digit_stack = pop_digit_stack (digit_stack);
            }
          }
        }
        if (input_number->left_of_decimal != NULL)
        {
          temp_left_of_decimal = input_number->left_of_decimal;
          while (temp_left_of_decimal != NULL)
          {
            if ((temp_left_of_decimal->highest_digit_position >= 0) && (temp_left_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < temp_left_of_decimal->highest_digit_position; i++)
              {
                packed_byte = temp_left_of_decimal->packed_number_block[i];
                nibble_low  = packed_byte & 0x0f;
                nibble_high = (packed_byte & 0xf0) >> 4;
                //printf ("nibble_low  = %x\n", nibble_low);
                //printf ("nibble_high = %x\n", nibble_high);
                converted_result = packed_string_integer_append_two_digits (converted_result, packed_byte);
              }
              if (temp_left_of_decimal->highest_nibble_position == hi)
              {
                packed_byte = temp_left_of_decimal->packed_number_block[i];
                nibble_low  = packed_byte & 0x0f;
                nibble_high = (packed_byte & 0xf0) >> 4;
                //printf ("nibble_low  = %x\n", nibble_low);
                //printf ("nibble_high = %x\n", nibble_high);
                converted_result = packed_string_integer_append_two_digits (converted_result, packed_byte);
              }
              else
              {
                if (temp_left_of_decimal->highest_nibble_position == lo)
                {
                  packed_byte = temp_left_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  //printf ("nibble_low  = %x\n", nibble_low);
                  converted_result = packed_string_integer_append_one_digit (converted_result, nibble_low);
                }
                else
                {
                  printf ("ERROR in copy_packed_string_float_digits_into_packed_string_integer(). temp_left_of_decimal->highest_nibble_position is undefined. Exiting now.\n");
                  exit (EXIT_FAILURE);
                }
              }
            }
            temp_left_of_decimal = temp_left_of_decimal->next_number_block;
          }
        }
      }
    } 
    else
    {
// **********************************************************************************
// * The input number is zero, therefore, create a converted stringint that's zero. *
// **********************************************************************************
      converted_result = packed_string_integer_initialize_to_zero (converted_result);
    }
  }
  return converted_result;
}




// ********************************************************************************************************************************************************************
// * copy_packed_string_integer_digits_into packed_string_float                                                                                                       *
// *                                                                                                                                                                  *
// * This is an unusual subroutine in that it copies all digits linearly from least sigificant digit RIGHT of decimal to most significant digit LEFT of decimal. This *
// * subroutine is NOT a general-purpose string integer to string float conversion program. Instead, this function is used internally for string-based floating point *
// * multiplication and division.                                                                                                                                     *
// ********************************************************************************************************************************************************************
psflt * copy_packed_string_integer_digits_into_packed_string_float (psflt *converted_result, psint *input_number, long long int total_number_of_digits_right_of_decimal)
{
  psnc *temp_input_number, *converted_result_left_of_decimal, *converted_result_right_of_decimal;
  unsigned char byte, packed_byte, nibble_low, nibble_high, done;
  long long int i, digit_counter;
  enum occupied_nibble;
  digit_stack_node *temp_digit_stack, *digit_stack_left_of_decimal, *digit_stack_right_of_decimal;

  converted_result_left_of_decimal  = NULL;
  converted_result_right_of_decimal = NULL;
  temp_digit_stack = NULL;
  digit_stack_left_of_decimal  = NULL;
  digit_stack_right_of_decimal = NULL;
  if (converted_result != NULL)
  {
    converted_result = packed_string_float_component_release_memory (converted_result);
  }
  if (input_number != NULL)
  {
    if (input_number->left_of_decimal != NULL)
    {
      if ((input_number->sign == positive) || (input_number->sign == negative))
      {
        if (total_number_of_digits_right_of_decimal == 0)
        {
// *****************************************************************************************************
// * There are no digits RIGHT of the decimal, therefore copy all stringint digits to LEFT of decimal. *
// *****************************************************************************************************
          digit_stack_left_of_decimal = NULL;
          temp_input_number = input_number->left_of_decimal;
          while (temp_input_number != NULL)
          {
            if ((temp_input_number->highest_digit_position >= 0) && (temp_input_number->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < temp_input_number->highest_digit_position; i++)
              { 
                packed_byte = temp_input_number->packed_number_block[i];
                converted_result_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (converted_result_left_of_decimal, packed_byte);
              }
              packed_byte = temp_input_number->packed_number_block[i];
              if (temp_input_number->highest_nibble_position == hi)
              {
                converted_result_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (converted_result_left_of_decimal, packed_byte);
              }
              else
              {
                if (temp_input_number->highest_nibble_position == lo)
                {
                  nibble_low  = packed_byte & 0x0f;
                  converted_result_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_result_left_of_decimal, nibble_low);
                }
              }
            }
            else
            {
              printf ("Internal error occurred in copy_packed_string_integer_digits_into_packed_string_float(). temp_input_number->highest_digit_position contains is either negative or exceeds MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_input_number = temp_input_number->next_number_block;
          }
        }
        else
        {
// ************************************************************************************************************************************************* 
// * First we must advance to TOTAL_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL byte-by-byte from the least significant digit in the string integer to the   *
// * most significant digit of the string integer. However, we must only advance enough bytes to the place where the decimal point should be. Then *
// * we will copy all digits from that point to the least significant digit in the string integer.                                                 *
// ************************************************************************************************************************************************* 
          digit_stack_right_of_decimal = NULL;
          digit_stack_left_of_decimal  = NULL;
          digit_counter = 0;
          temp_input_number = input_number->left_of_decimal;
          while (temp_input_number != NULL)
          {
            if ((temp_input_number->highest_digit_position >= 0) && (temp_input_number->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < temp_input_number->highest_digit_position; i++)
              { 
                packed_byte = temp_input_number->packed_number_block[i];
                nibble_low  = packed_byte & 0x0f;
                nibble_high = (packed_byte & 0xf0) >> 4;
                if (digit_counter < total_number_of_digits_right_of_decimal)
                {
                  digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, nibble_low + '0');
                  digit_counter++;
                }
                else
                {
                  digit_stack_left_of_decimal = push_digit_stack (digit_stack_left_of_decimal, nibble_low + '0');
                }
                if (digit_counter < total_number_of_digits_right_of_decimal)
                {
                  digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, nibble_high + '0');
                  digit_counter++;
                }
                else
                {
                  digit_stack_left_of_decimal = push_digit_stack (digit_stack_left_of_decimal, nibble_high + '0');
                }
              }
              if (temp_input_number->highest_nibble_position == hi)
              {
                packed_byte = temp_input_number->packed_number_block[i];
                nibble_low  = packed_byte & 0x0f;
                nibble_high = (packed_byte & 0xf0) >> 4;
                if (digit_counter < total_number_of_digits_right_of_decimal)
                {
                  digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, nibble_low + '0');
                  digit_counter++;
                }
                else
                {
                  digit_stack_left_of_decimal = push_digit_stack (digit_stack_left_of_decimal, nibble_low + '0');
                }
                if (digit_counter < total_number_of_digits_right_of_decimal)
                {
                  digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, nibble_high + '0');
                  digit_counter++;
                }
                else
                {
                  digit_stack_left_of_decimal = push_digit_stack (digit_stack_left_of_decimal, nibble_high + '0');
                }
              }
              else
              {
                if (temp_input_number->highest_nibble_position == lo)
                {
                  packed_byte = temp_input_number->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  if (digit_counter < total_number_of_digits_right_of_decimal)
                  {
                    digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, nibble_low + '0');
                    digit_counter++;
                  }
                  else
                  {
                    digit_stack_left_of_decimal = push_digit_stack (digit_stack_left_of_decimal, nibble_low + '0');
                  }
                }
                else
                {
                  printf ("Internal error occurred in copy_packed_string_integer_digits_into_packed_string_float(). temp_input_number->highest_nibble_position is undefined. Exiting now.\n");
                  exit (EXIT_FAILURE);
                }
              }
            }
            else
            {
              printf ("Internal error occurred in copy_packed_string_integer_digits_into_packed_string_float(). temp_input_number->highest_digit_position contains is either negative or exceeds MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_input_number = temp_input_number->next_number_block;
          }
// *************************************************************************************************
// * Before digits can be appended to LEFT of DECIMAL, the stack digits must be reversed such that *
// * the least signficiant digit LEFT of DECIMAL is at the top of the stack.                       *
// *************************************************************************************************
          while (digit_stack_left_of_decimal != NULL)
          {
            byte = top_digit_stack (digit_stack_left_of_decimal);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack_left_of_decimal = pop_digit_stack (digit_stack_left_of_decimal);
          }
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            byte = byte - '0';
            converted_result_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_result_left_of_decimal, byte);
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
// *******************************************************************************************************************************
// * Reverse the order of digits RIGHT of DECIMAL such that the least significant digit RIGHT of DECIMAL is on top of the stack. *
// *******************************************************************************************************************************
          while (digit_stack_right_of_decimal != NULL)
          {
            byte = top_digit_stack (digit_stack_right_of_decimal);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack_right_of_decimal = pop_digit_stack (digit_stack_right_of_decimal);
          }
          done = FALSE;
          while ((temp_digit_stack != NULL) && (!done))
          {
            byte = top_digit_stack (temp_digit_stack);
// *************************************************************************
// * If the least significant digit RIGHT of DECIMAL is a zero, remove it. *
// *************************************************************************
            if (byte > '0')
            {
              done = TRUE;
            }
            else
            {
              temp_digit_stack = pop_digit_stack (temp_digit_stack);
            }
          }
// **************************************************************************************************************
// * Now reverse the order of the stack again since the least significant digit RIGHT of DECIMAL is not a zero. *
// **************************************************************************************************************
          digit_counter = 0;
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, byte);
            digit_counter++;
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
// *******************************************************************************************
// * Add one or more zero digits to RIGHT of DECIMAL in the MOST significant digit position. *
// *******************************************************************************************
          //while (digit_counter < total_number_of_digits_right_of_decimal)
          //{
          //  digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, '0');
          //  digit_counter++;
          //}
          while (digit_stack_right_of_decimal != NULL)
          {
            byte = top_digit_stack (digit_stack_right_of_decimal);
            byte = byte - '0';
            converted_result_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_result_right_of_decimal, byte);
            digit_stack_right_of_decimal = pop_digit_stack (digit_stack_right_of_decimal);
          }
        }
        if ((converted_result_left_of_decimal != NULL) || (converted_result_right_of_decimal != NULL))
        {
          converted_result = (psflt *) malloc(sizeof(psflt));
          if (converted_result != NULL)
          {
            converted_result->sign = input_number->sign;
            converted_result->left_of_decimal  = converted_result_left_of_decimal;
            converted_result->right_of_decimal = converted_result_right_of_decimal;
            converted_result->status_flag = 0;
          }
        }
      } 
      else
      {
// *********************************************************************************************************
// * The input number is zero, therefore, create a packed string-based floating-point number that is zero. *
// *********************************************************************************************************
        converted_result = packed_string_float_initialize_to_zero (converted_result);
      }
    }
  }
  return converted_result;
}





// **************************************************************************************************************************************
// * copy_packed_string_integer_digits_into_left_packed_string_float_component                                                          *
// *                                                                                                                                    *
// * This is an unusual subroutine in that it splits and copies some of the digits from a packed string-based integer input number into *
// * the left of decimal components of a packed string-based floating-point number.                                                     *
// *                                                                                                                                    *
// *                                                                                                                                    *
// * The digits in the stringint are copied from least-significant-digit to the most-significant-digit.                                 *
// **************************************************************************************************************************************
psnc * copy_packed_string_integer_digits_into_left_packed_string_float_component (psint *input_number, unsigned long long int total_number_of_digits_right_of_decimal)
{
  psnc *temp_input_number, *left_of_decimal_string_float_component;
  unsigned char packed_byte, nibble_high, repacked_byte;
  long long int i;
  unsigned long long int number_of_digits_skipped;

  left_of_decimal_string_float_component = NULL;
  if (input_number != NULL)
  {
    if (input_number->left_of_decimal != NULL)
    {
      if ((input_number->sign == positive) || (input_number->sign == negative))
      {
        number_of_digits_skipped = 0;
        temp_input_number = input_number->left_of_decimal;
        while (temp_input_number != NULL)
        {
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            packed_byte = temp_input_number->packed_number_block[i];
            if (number_of_digits_skipped > total_number_of_digits_right_of_decimal)
            {
              left_of_decimal_string_float_component = packed_string_float_append_two_digits_left_of_decimal (left_of_decimal_string_float_component, packed_byte);
            }
            else
            {
              if ((number_of_digits_skipped + 1) >= total_number_of_digits_right_of_decimal)
              {
                // skip the low nibble (it counts as one digit) because it represents the last digit to skip. The low nibble will be stored at RIGHT of decimal instead.
                nibble_high = (packed_byte & 0xf0) >> 4;
                repacked_byte = nibble_high;
                left_of_decimal_string_float_component = packed_string_float_append_two_digits_left_of_decimal (left_of_decimal_string_float_component, repacked_byte);
                number_of_digits_skipped++;
              }
              else
              {
                number_of_digits_skipped = number_of_digits_skipped + 2;
              }
            }
          }    
          temp_input_number = temp_input_number->next_number_block;
        }
      }
      else
      {
        left_of_decimal_string_float_component = (psnc *) malloc(sizeof(psnc));
        if (left_of_decimal_string_float_component != NULL)
        {
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            left_of_decimal_string_float_component->packed_number_block[i] = 0;
          }
          left_of_decimal_string_float_component->highest_digit_position = 0;
          left_of_decimal_string_float_component->first_number_block     = left_of_decimal_string_float_component;
          left_of_decimal_string_float_component->last_number_block      = left_of_decimal_string_float_component;
          left_of_decimal_string_float_component->previous_number_block  = NULL;
          left_of_decimal_string_float_component->next_number_block      = NULL;
        }
        else
        {
          printf ("ERROR: malloc() failed to allocate memory in copy_packed_string_integer_digits_into_left_packed_string_float_component\n");
          exit (1);
        }
      }
    }
  } 
  return left_of_decimal_string_float_component;
}




// *****************************************************************************************************
// * _packed_string_float_divide                                                                       *
// *                                                                                                   *
// * This internal subroutine computes the division of two packed string-based floating-point numbers. *
// *                                                                                                   *    
// * This is an internal library. It should not be called directly from end-users. Instead, this       *
// * this subroutine should be called from packed_string_float_divide.                                 *
// *****************************************************************************************************
psflt * _packed_string_float_divide (psflt *quotient_and_remainder, psflt *numerator, psflt *denominator, long long int num_digits_of_precision_right_of_decimal)
{
  psint *integer_quotient, *integer_remainder, *numerator_integer, *denominator_integer, *temp_numerator_integer, *factor;
  psint *adjusted_numerator_integer, *adjusted_denominator_integer;
  psint *constant_0, *constant_1, *constant_2, *constant_3, *constant_4, *constant_5, *constant_6, *constant_7, *constant_8, *constant_9, *constant_10;
  psnc *temp_integer_quotient_component, *temp_numerator_right_of_decimal, *temp_denominator_right_of_decimal, *stringfloat_left_of_decimal, *stringfloat_right_of_decimal;
  psint_list_node *stringint_list;
  digit_stack_node *digit_stack, *temp_digit_stack;
  int state, terminating_division, remainder_is_zero;
  int greater_number_test;
  long long int i, counter;
  long long int numerator_number_of_digits_right_of_decimal, denominator_number_of_digits_right_of_decimal, total_number_of_digits_right_of_decimal;
  long long int max_digits_to_compute_division, number_of_decimal_shifts;
  unsigned char denominator_only_contains_factors_two_and_five;
  unsigned char byte, packed_byte, nibble_low, nibble_high, numerator_is_zero;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (quotient_and_remainder != NULL)
  {
    quotient_and_remainder = packed_string_float_component_release_memory (quotient_and_remainder);
  }
  constant_0  = NULL;
  constant_1  = NULL;
  constant_2  = NULL;
  constant_3  = NULL;
  constant_4  = NULL;
  constant_5  = NULL;
  constant_6  = NULL;
  constant_7  = NULL;
  constant_8  = NULL;
  constant_9  = NULL;
  constant_10 = NULL;
  digit_stack = NULL;
  factor      = NULL;
  numerator_integer      = NULL;
  denominator_integer    = NULL;
  adjusted_numerator_integer   = NULL;
  adjusted_denominator_integer = NULL;
  stringfloat_left_of_decimal  = NULL;
  stringfloat_right_of_decimal = NULL;
  numerator_number_of_digits_right_of_decimal   = 0;
  denominator_number_of_digits_right_of_decimal = 0;
  total_number_of_digits_right_of_decimal       = 0;
  max_digits_to_compute_division                = 0;
  terminating_division    = FALSE;
  remainder_is_zero       = FALSE;
  constant_0  = packed_string_integer_set_value (constant_0, "0");
  constant_1  = packed_string_integer_set_value (constant_1, "1");
  constant_2  = packed_string_integer_set_value (constant_2, "2");
  constant_3  = packed_string_integer_set_value (constant_3, "3");
  constant_4  = packed_string_integer_set_value (constant_4, "4");
  constant_5  = packed_string_integer_set_value (constant_5, "5");
  constant_6  = packed_string_integer_set_value (constant_6, "6");
  constant_7  = packed_string_integer_set_value (constant_7, "7");
  constant_8  = packed_string_integer_set_value (constant_8, "8");
  constant_9  = packed_string_integer_set_value (constant_9, "9");
  constant_10 = packed_string_integer_set_value (constant_10, "10");
  if ((numerator != NULL) && (denominator != NULL) && (constant_0 != NULL) && (constant_1 != NULL) && (constant_2 != NULL) && (constant_3 != NULL) && 
      (constant_4 != NULL) && (constant_5 != NULL)  && (constant_6 != NULL) && (constant_7 != NULL) && (constant_8 != NULL) && (constant_9 != NULL) && 
      (constant_10 != NULL))
  {
// ***********************************************************************************************************************************************
// * First I convert the numerator (a stringfloat) into a stringint. I preserve digit order and position (left of decimal and right of decimal). *
// ***********************************************************************************************************************************************
    if ((numerator->left_of_decimal != NULL) || (numerator->right_of_decimal != NULL))
    {
      numerator_integer = copy_packed_string_float_digits_into_packed_string_integer (numerator_integer, numerator);
      numerator_number_of_digits_right_of_decimal = 0;
      if (numerator->right_of_decimal != NULL)
      {
// *********************************************************************************
// * Now count the number of significant digits right of the decimal for numerator *
// *********************************************************************************
        state = 0;
        temp_numerator_right_of_decimal = numerator->right_of_decimal->last_number_block;
        while (temp_numerator_right_of_decimal != NULL)
        {
          i = temp_numerator_right_of_decimal->highest_digit_position;
          if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
          {
            while (i >= 0) 
            {
              switch (state)
              {
                case 0:
                  packed_byte = temp_numerator_right_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  if (nibble_high > 0)
                  {
                    numerator_number_of_digits_right_of_decimal = numerator_number_of_digits_right_of_decimal - 2;
                    state = 10;
                  }
                  else
                  {
                    if (nibble_low > 0)
                    {
                      numerator_number_of_digits_right_of_decimal = numerator_number_of_digits_right_of_decimal - 1;
                      state = 10;
                    }
                  } 
                break;
                case 10:
                  numerator_number_of_digits_right_of_decimal = numerator_number_of_digits_right_of_decimal - 2;
                break;
                default:
                break;
              }
              i--;
            }
          }   
          temp_numerator_right_of_decimal = temp_numerator_right_of_decimal->previous_number_block;
        }
      }
    }
// *************************************************************************************************************************************************
// * Next, I convert the denominator (a stringfloat) into a stringint. I preserve digit order and position (left of decimal and right of decimal). *
// *************************************************************************************************************************************************
    if ((denominator->left_of_decimal != NULL) || (denominator->right_of_decimal != NULL))
    {
      denominator_integer = copy_packed_string_float_digits_into_packed_string_integer (denominator_integer, denominator);
// **************************************************************************************************************************************************
// * Count the number of digits in DENOMINATOR_INTEGER. This count will serve as the maximum number of times to iterate to determine the fractional *
// * result of the division.                                                                                                                        *
// **************************************************************************************************************************************************
      if (denominator_integer != NULL)
      {
        //printf ("denominator_integer:\n");
        //display_packed_string_integer_structure (denominator_integer);
        //printf ("\n\n");
      }
      denominator_number_of_digits_right_of_decimal = 0;
      if (denominator->right_of_decimal != NULL)
      {
// *******************************************************************************
// * Count the number of significant digits right of the decimal for denominator *
// *******************************************************************************
        state = 0;
        temp_denominator_right_of_decimal = denominator->right_of_decimal->last_number_block;
        while (temp_denominator_right_of_decimal != NULL)
        {
          i = temp_denominator_right_of_decimal->highest_digit_position;
          if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
          {
            while (i >= 0) 
            {
              switch (state)
              {
                case 0:
                  packed_byte = temp_denominator_right_of_decimal->packed_number_block[i];
                  nibble_low  = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  if (nibble_high > 0)
                  {
                    denominator_number_of_digits_right_of_decimal = denominator_number_of_digits_right_of_decimal - 2;
                    state = 10;
                  }
                  else
                  {
                    if (nibble_low > 0)
                    {
                      denominator_number_of_digits_right_of_decimal = denominator_number_of_digits_right_of_decimal - 1;
                      state = 10;
                    }
                  } 
                break;
                case 10:
                  denominator_number_of_digits_right_of_decimal = denominator_number_of_digits_right_of_decimal - 2;
                break;
                default:
                break;
              }
              i--;
            }
          }   
          temp_denominator_right_of_decimal = temp_denominator_right_of_decimal->previous_number_block;
        }
      }
    }
  }
  if (llabs(numerator_number_of_digits_right_of_decimal) > llabs(denominator_number_of_digits_right_of_decimal))
  {
    //printf ("numerator_number_of_digits_right_of_decimal > denominator_number_of_digits_right_of_decimal\n");
    number_of_decimal_shifts = llabs(numerator_number_of_digits_right_of_decimal) - llabs(denominator_number_of_digits_right_of_decimal);
    //printf ("number_of_decimal_shifts = %lld\n", number_of_decimal_shifts);
    adjusted_numerator_integer = packed_string_integer_copy_number (adjusted_numerator_integer, numerator_integer);
    adjusted_denominator_integer = packed_string_integer_shift_digits_left (denominator_integer, number_of_decimal_shifts);     
    adjusted_denominator_integer = packed_string_integer_set_sign (adjusted_denominator_integer, denominator_integer->sign);
  }
  else
  {
    if (llabs(denominator_number_of_digits_right_of_decimal) > llabs(numerator_number_of_digits_right_of_decimal))
    { 
      //printf ("denominator_number_of_digits_right_of_decimal > numerator_number_of_digits_right_of_decimal\n");
      number_of_decimal_shifts = llabs(denominator_number_of_digits_right_of_decimal) - llabs(numerator_number_of_digits_right_of_decimal);
      //printf ("number_of_decimal_shifts = %lld\n", number_of_decimal_shifts);
      adjusted_numerator_integer = packed_string_integer_shift_digits_left (numerator_integer, number_of_decimal_shifts);     
      adjusted_numerator_integer = packed_string_integer_set_sign (adjusted_numerator_integer, numerator_integer->sign);
      adjusted_denominator_integer = packed_string_integer_copy_number (adjusted_denominator_integer, denominator_integer);
    }
    else
    {
      //printf ("numerator_number_of_digits_right_of_decimal == denominator_number_of_digits_right_of_decimal\n");
      adjusted_numerator_integer = packed_string_integer_copy_number (adjusted_numerator_integer, numerator_integer);
      adjusted_denominator_integer = packed_string_integer_copy_number (adjusted_denominator_integer, denominator_integer);
    }
  }
  max_digits_to_compute_division = count_num_digits_in_packed_string_integer (adjusted_denominator_integer) * 10;

  //printf ("numerator   = ");
  //packed_string_float_display (numerator, 0);
  //printf ("\n");
  //printf ("denominator = ");
  //packed_string_float_display (denominator, 0);
  //printf ("\n");
  //printf ("numerator_integer   = ");
  //packed_string_integer_display (numerator_integer, 0);
  //printf ("\n");
  //printf ("denominator_integer = ");
  //packed_string_integer_display (denominator_integer, 0);
  //printf ("\n");
  //printf ("adjusted_numerator_integer   = ");
  //packed_string_integer_display (adjusted_numerator_integer, 0);
  //printf ("\n");
  //printf ("adjusted_denominator_integer = ");
  //packed_string_integer_display (adjusted_denominator_integer, 0);
  //printf ("\n");
  //printf ("numerator_number_of_digits_right_of_decimal    = %lld\n", numerator_number_of_digits_right_of_decimal);
  //printf ("denominator_number_of_digits_right_of_decimal  = %lld\n", denominator_number_of_digits_right_of_decimal);
  //printf ("max_digits_to_compute_division                 = %lld\n", max_digits_to_compute_division);
  numerator_integer   = packed_string_integer_component_release_memory (numerator_integer);
  denominator_integer = packed_string_integer_component_release_memory (denominator_integer);
  numerator_integer   = packed_string_integer_copy_number (numerator_integer, adjusted_numerator_integer);
  denominator_integer = packed_string_integer_copy_number (denominator_integer, adjusted_denominator_integer);
  adjusted_numerator_integer   = packed_string_integer_release_memory (adjusted_numerator_integer);
  adjusted_denominator_integer = packed_string_integer_release_memory (adjusted_denominator_integer);


  integer_quotient  = NULL;
  integer_remainder = NULL;
  if ((numerator_integer != NULL) && (denominator_integer != NULL)) 
  {
    greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (numerator_integer, denominator_integer);
// **************************************************
// * Is the numerator greater-than the denominator? *
// **************************************************
    if (greater_number_test == 1)
    {
// ******************************************************************
// * Yes! Compute the division to determine quotient and remainder. *
// ******************************************************************
      stringint_list = packed_string_integer_divide_returning_quotient_and_remainder (numerator_integer, denominator_integer);
      if (stringint_list != NULL)
      {
        integer_quotient = stringint_list->element; 
        if (stringint_list->next_element != NULL)
        {
          integer_remainder = stringint_list->next_element->element;
          free (stringint_list->next_element);
          free (stringint_list);
          stringint_list = NULL;
        }
      }
    }
    else
    {
// **********************************************
// * Is the numerator equal to the denominator? *
// **********************************************
      if (greater_number_test == 0)
      {
// *******************************************************************
// * Yes! Set INTEGER_QUOTIENT to one and INTEGER_REMAINDER to zero. *
// *******************************************************************
        integer_quotient  = packed_string_integer_set_value (integer_quotient, "1");
        integer_remainder = packed_string_integer_initialize_to_zero (integer_remainder);
      }
      else
      {
// ***********************************************
// * Is the numerator less-than the denominator? *
// ***********************************************
        if (greater_number_test == -1)
        {
// ************************************************************************************************************
// * Yes! Set INTEGER_QUOTIENT to zero then copy NUMERATOR_INTEGER to INTEGER_REMAINDER for further division. *
// ************************************************************************************************************
          integer_quotient  = packed_string_integer_initialize_to_zero (integer_quotient);
          integer_remainder = packed_string_integer_copy_number (integer_remainder, numerator_integer);
        }
        else
        {
          if (greater_number_test == -2)
          {
            printf ("Internal system error occurred. Subroutine packed_string_integer_determine_absolute_value_larger_of_two_integers returned -2. Exiting now.\n");
            exit (EXIT_FAILURE);
          }
          else
          {
            printf ("Internal system error occurred. Subroutine packed_string_integer_determine_absolute_value_larger_of_two_integers returned unknown value. Exiting now.\n");
            exit (EXIT_FAILURE);
          }
        }
      }
    }
    //printf ("integer_quotient  = ");
    //packed_string_integer_display (integer_quotient, 0);
    //printf ("\n");
    //printf ("integer_remainder = ");
    //packed_string_integer_display (integer_remainder, 0);
    //printf ("\n");
// ******************************************************************************
// * Copy appropriate number of digits from INTEGER QUOTIENT onto the resultant *
// * digit stack which represents digits comprising the final answer.           *
// ******************************************************************************
    if (integer_quotient != NULL)
    {
      if (integer_quotient->left_of_decimal != NULL)
      {
        temp_digit_stack = NULL;
        temp_integer_quotient_component = integer_quotient->left_of_decimal;
        while (temp_integer_quotient_component != NULL)
        {
          if ((temp_integer_quotient_component->highest_digit_position >= 0) && (temp_integer_quotient_component->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            i = 0;
            while (i < temp_integer_quotient_component->highest_digit_position)
            {
              packed_byte = temp_integer_quotient_component->packed_number_block[i];
              nibble_low = packed_byte & 0x0f;
              nibble_high = (packed_byte & 0xf0) >> 4;
              stringfloat_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (stringfloat_left_of_decimal, nibble_low);
              stringfloat_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (stringfloat_left_of_decimal, nibble_high);
              i++;
            }
            packed_byte = temp_integer_quotient_component->packed_number_block[i];
            nibble_low = packed_byte & 0x0f;
            nibble_high = (packed_byte & 0xf0) >> 4;
            if (temp_integer_quotient_component->highest_nibble_position == lo)
            {
              stringfloat_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (stringfloat_left_of_decimal, nibble_low);
            }
            else
            {
              if (temp_integer_quotient_component->highest_nibble_position == hi)
              {
                stringfloat_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (stringfloat_left_of_decimal, nibble_low);
                stringfloat_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (stringfloat_left_of_decimal, nibble_high);
              }      
            }
          } 
          temp_integer_quotient_component = temp_integer_quotient_component->next_number_block;
        }
// *********************************************************************
// * Now reverse the temp stack ordering and push onto the final stack *
// *********************************************************************
        digit_stack = NULL;
        while (temp_digit_stack != NULL)
        {
          byte = top_digit_stack (temp_digit_stack);
          digit_stack = push_digit_stack (digit_stack, byte);
          temp_digit_stack = pop_digit_stack (temp_digit_stack);
        }
      }
    }
    greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (integer_remainder, constant_0);
    if (greater_number_test == 1)
    {
// *************************************************************************************************************
// * Since there is a remainder, I must determine if the denominator contains prime number factors 2 and/or 5. *
// * If any other numbers exist (such as 3, 7, 11, 13, etc. then the decimal result will repeat forever.       *
// *************************************************************************************************************
      remainder_is_zero = FALSE;
      factor = packed_string_integer_copy_number (factor, denominator_integer);
      factor = packed_string_integer_set_sign (factor, positive);
      denominator_only_contains_factors_two_and_five = packed_string_integer_contains_only_two_and_five_as_factors (factor);
      factor = packed_string_integer_release_memory (factor);
      if (denominator_only_contains_factors_two_and_five)
      {
        terminating_division = TRUE;
        //printf ("Good! The division will terminate.\n");
      }
      else
      {
        terminating_division = FALSE;
        //printf ("WARNING: The division is repeating, non-terminating.\n");
      }
    }
    else
    {
      terminating_division = TRUE;
      remainder_is_zero = TRUE;
      //printf ("Good! The division will terminate.\n");
    }
    if (terminating_division)
    {
      if (remainder_is_zero)
      {
        if (total_number_of_digits_right_of_decimal > 0)
        {
// *********************************************************************************************
// * The DIGIT stack contains all digits RIGHT of DECIMAL but the digits are in reverse order. *
// * POP the digits into a temporary stack to reverse the ordering.                            *
// *********************************************************************************************
          temp_digit_stack = NULL;
          while (digit_stack != NULL)
          {
            byte = top_digit_stack (digit_stack);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack = pop_digit_stack (digit_stack);
          }
// *******************************************************************************************************
// * Now pop all digits off the TEMP_DIGIT_STACK digits and append them to STRINGFLOAT_RIGHT_OF_DECIMAL. *
// *******************************************************************************************************
          stringfloat_right_of_decimal = NULL;
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            byte = byte - '0';
            stringfloat_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (stringfloat_right_of_decimal, byte);
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
        }
      }
      else
      {
        if (integer_remainder != NULL)
        {
          greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (integer_remainder, constant_0);
          while (greater_number_test == 1)
          {
            integer_quotient  = packed_string_integer_component_release_memory (integer_quotient);
            numerator_integer = packed_string_integer_component_release_memory (numerator_integer);
            numerator_integer = packed_string_integer_shift_digits_left (integer_remainder, 1); // multiply by ten.
            numerator_integer = packed_string_integer_set_sign (numerator_integer, positive);
            integer_remainder = packed_string_integer_component_release_memory (integer_remainder);
            greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (numerator_integer, denominator_integer);
            numerator_is_zero = packed_string_integer_equal (numerator_integer, constant_0);
            while ((greater_number_test == -1) && (!numerator_is_zero))
            {
              digit_stack = push_digit_stack (digit_stack, '0');
              temp_numerator_integer = packed_string_integer_shift_digits_left (numerator_integer, 1); // multiply by ten.
              temp_numerator_integer = packed_string_integer_set_sign (temp_numerator_integer, positive);
              numerator_integer = packed_string_integer_component_release_memory (numerator_integer);
              numerator_integer = packed_string_integer_copy_number (numerator_integer, temp_numerator_integer);
              temp_numerator_integer = packed_string_integer_release_memory (temp_numerator_integer);
              greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (numerator_integer, denominator_integer);
              numerator_is_zero = packed_string_integer_equal (numerator_integer, constant_0);
            }       
            stringint_list = packed_string_integer_divide_returning_quotient_and_remainder (numerator_integer, denominator_integer);
            if (stringint_list != NULL)
            {
              integer_quotient = stringint_list->element; 
              if (stringint_list->next_element != NULL)
              {
                integer_remainder = stringint_list->next_element->element;
                free (stringint_list->next_element);
                free (stringint_list);
                stringint_list = NULL;
              }
            }
            if (integer_quotient != NULL)
            {
              if (integer_quotient->left_of_decimal != NULL)
              {
                temp_integer_quotient_component = integer_quotient->left_of_decimal->last_number_block;
                while (temp_integer_quotient_component != NULL)
                {
                  i = temp_integer_quotient_component->highest_digit_position;
                  if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    packed_byte = temp_integer_quotient_component->packed_number_block[i];
                    nibble_low = packed_byte & 0x0f;
                    nibble_high = (packed_byte & 0xf0) >> 4;
                    if (temp_integer_quotient_component->highest_nibble_position == lo)
                    {
                      digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                    }
                    else
                    {
                      if (temp_integer_quotient_component->highest_nibble_position == hi)
                      {
                        digit_stack = push_digit_stack (digit_stack, nibble_high + '0');
                        digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                      }
                    }
                    i--;
                    while (i >= 0)
                    {
                      packed_byte = temp_integer_quotient_component->packed_number_block[i];
                      nibble_low = packed_byte & 0x0f;
                      nibble_high = (packed_byte & 0xf0) >> 4;
                      digit_stack = push_digit_stack (digit_stack, nibble_high + '0');
                      digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                      i--;
                    }
                  }
                  temp_integer_quotient_component = temp_integer_quotient_component->previous_number_block;
                }
              }
            }
            greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (integer_remainder, constant_0);
          }
// *********************************************************************************************
// * The DIGIT stack contains all digits RIGHT of DECIMAL but the digits are in reverse order. *
// * POP the digits into a temporary stack to reverse the ordering.                            *
// *********************************************************************************************
          temp_digit_stack = NULL;
          while (digit_stack != NULL)
          {
            byte = top_digit_stack (digit_stack);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack = pop_digit_stack (digit_stack);
          }
// *******************************************************************************************************
// * Now pop all digits off the TEMP_DIGIT_STACK digits and append them to STRINGFLOAT_RIGHT_OF_DECIMAL. *
// *******************************************************************************************************
          stringfloat_right_of_decimal = NULL;
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            byte = byte - '0';
            stringfloat_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (stringfloat_right_of_decimal, byte);
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
        }
      }
    }
    else
    {
// **************************************
// * Non-terminating, repeating decimal *
// **************************************
      if ((integer_quotient != NULL) && (integer_remainder != NULL))
      {
        if (total_number_of_digits_right_of_decimal >= 0)
        {
          if (num_digits_of_precision_right_of_decimal > 0)
          {
            max_digits_to_compute_division = num_digits_of_precision_right_of_decimal;
          }
          else
          {
            max_digits_to_compute_division = 1;
          }
          counter = 0;
          greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (integer_remainder, constant_0);
          while ((counter < max_digits_to_compute_division) && (greater_number_test == 1))
          {
            integer_quotient  = packed_string_integer_component_release_memory (integer_quotient);
            numerator_integer = packed_string_integer_component_release_memory (numerator_integer);
            numerator_integer = packed_string_integer_shift_digits_left (integer_remainder, 1); // multiply by ten.
            numerator_integer = packed_string_integer_set_sign (numerator_integer, positive);
            integer_remainder = packed_string_integer_component_release_memory (integer_remainder);
            greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (numerator_integer, denominator_integer);
            numerator_is_zero = packed_string_integer_equal (numerator_integer, constant_0);
            while ((greater_number_test == -1) && (!numerator_is_zero) && (counter < max_digits_to_compute_division))
            {
              counter++;
              digit_stack = push_digit_stack (digit_stack, '0');
              temp_numerator_integer = packed_string_integer_shift_digits_left (numerator_integer, 1); // multiply by ten.
              temp_numerator_integer = packed_string_integer_set_sign (temp_numerator_integer, positive);
              numerator_integer = packed_string_integer_component_release_memory (numerator_integer);
              numerator_integer = packed_string_integer_copy_number (numerator_integer, temp_numerator_integer);
              temp_numerator_integer = packed_string_integer_release_memory (temp_numerator_integer);
              greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (numerator_integer, denominator_integer);
              numerator_is_zero = packed_string_integer_equal (numerator_integer, constant_0);
            }       
            stringint_list = packed_string_integer_divide_returning_quotient_and_remainder (numerator_integer, denominator_integer);
            if (stringint_list != NULL)
            {
              integer_quotient = stringint_list->element; 
              if (stringint_list->next_element != NULL)
              {
                integer_remainder = stringint_list->next_element->element;
                free (stringint_list->next_element);
                free (stringint_list);
                stringint_list = NULL;
              }
            }
// *********************************************************************************************************************************************************************
// * Count the number of digits in the quotient. This is important as I must keep track of the total number of digits of precision before leaving the main while loop. *
// *********************************************************************************************************************************************************************
            if (integer_quotient != NULL)
            {
              if (integer_quotient->left_of_decimal != NULL)
              {
                temp_integer_quotient_component = integer_quotient->left_of_decimal->last_number_block;
                while ((temp_integer_quotient_component != NULL) && (total_number_of_digits_right_of_decimal < num_digits_of_precision_right_of_decimal))
                {
                  i = temp_integer_quotient_component->highest_digit_position;
                  if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    packed_byte = temp_integer_quotient_component->packed_number_block[i];
                    nibble_low = packed_byte & 0x0f;
                    nibble_high = (packed_byte & 0xf0) >> 4;
                    if (temp_integer_quotient_component->highest_nibble_position == lo)
                    {
                      digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                      counter++;
                    }
                    else
                    {
                      if (temp_integer_quotient_component->highest_nibble_position == hi)
                      {
                        digit_stack = push_digit_stack (digit_stack, nibble_high + '0');
                        counter++;
                        digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                        counter++;
                      }
                    }
                    i--;
                    while ((i >= 0) && (counter < max_digits_to_compute_division))
                    {
                      packed_byte = temp_integer_quotient_component->packed_number_block[i];
                      nibble_low = packed_byte & 0x0f;
                      nibble_high = (packed_byte & 0xf0) >> 4;
                      digit_stack = push_digit_stack (digit_stack, nibble_high + '0');
                      counter++;
                      digit_stack = push_digit_stack (digit_stack, nibble_low + '0');
                      counter++;
                      i--;
                    }
                  }
                  temp_integer_quotient_component = temp_integer_quotient_component->previous_number_block;
                }
              }
            }
            greater_number_test = packed_string_integer_determine_absolute_value_larger_of_two_integers (integer_remainder, constant_0);
          }
// **********************************************************************************************
// * The DIGIT stack contains all digits from the division but the digits are in reverse order. *
// * POP the digits into a temporary stack to reverse the ordering.                             *
// **********************************************************************************************
          temp_digit_stack = NULL;
          while (digit_stack != NULL)
          {
            byte = top_digit_stack (digit_stack);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack = pop_digit_stack (digit_stack);
          }
// *******************************************************************************************************
// * Now pop all digits off the TEMP_DIGIT_STACK digits and append them to STRINGFLOAT_RIGHT_OF_DECIMAL. *
// *******************************************************************************************************
          counter = 0;
          while ((temp_digit_stack != NULL) && (counter < num_digits_of_precision_right_of_decimal))
          {
            byte = top_digit_stack (temp_digit_stack);
            byte = byte - '0';
            stringfloat_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (stringfloat_right_of_decimal, byte);
            counter++;
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
          while (temp_digit_stack != NULL)
          {
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
        }
      }
    }
  }
  if (quotient_and_remainder == NULL)
  {
    if ((stringfloat_left_of_decimal != NULL) || (stringfloat_right_of_decimal != NULL))
    {
      quotient_and_remainder = (psflt *) malloc(sizeof(psflt));
      if (quotient_and_remainder != NULL)
      {
        quotient_and_remainder->left_of_decimal  = NULL;
        quotient_and_remainder->right_of_decimal = NULL;
        //quotient_and_remainder->exponent = NULL;
        quotient_and_remainder->status_flag = 0;
        quotient_and_remainder->sign = positive; // this is just to initialize the sign. It should be appropriately updated in packed_string_float_divide (the calling routine to this routine).
        if (!terminating_division)
        {
          quotient_and_remainder->status_flag = REPEATING_NONTERMINATING;
        }
        if (stringfloat_left_of_decimal != NULL)
        {
          quotient_and_remainder->left_of_decimal = stringfloat_left_of_decimal; 
        }
        if (stringfloat_right_of_decimal != NULL)
        {
          quotient_and_remainder->right_of_decimal = stringfloat_right_of_decimal; 
        }
      }
    }
  }
// *********************************************************************************************
// * Release memory for all temporary variables used to compute to the quotient and remainder. *
// *********************************************************************************************
  if (integer_quotient != NULL)
  {
    integer_quotient = packed_string_integer_release_memory (integer_quotient);
  }
  if (integer_remainder != NULL)
  {
    integer_remainder = packed_string_integer_release_memory (integer_remainder);
  }
  if (numerator_integer != NULL)
  {
    numerator_integer = packed_string_integer_release_memory (numerator_integer);
  }
  if (denominator_integer != NULL)
  {
    denominator_integer = packed_string_integer_release_memory (denominator_integer);
  }
// **********************************************
// * Now release allocated memory for constants *
// **********************************************
  if (constant_0 != NULL)
  {
    constant_0 = packed_string_integer_release_memory (constant_0);
  }
  if (constant_1 != NULL)
  {
    constant_1 = packed_string_integer_release_memory (constant_1);
  }
  if (constant_2 != NULL)
  {
    constant_2 = packed_string_integer_release_memory (constant_2);
  }   
  if (constant_3 != NULL)
  {
    constant_3 = packed_string_integer_release_memory (constant_3);
  }   
  if (constant_4 != NULL)
  {
    constant_4 = packed_string_integer_release_memory (constant_4);
  }   
  if (constant_5 != NULL)
  {
    constant_5 = packed_string_integer_release_memory (constant_5);
  }   
  if (constant_6 != NULL)
  {
    constant_6 = packed_string_integer_release_memory (constant_6);
  }   
  if (constant_7 != NULL)
  {
    constant_7 = packed_string_integer_release_memory (constant_7);
  }   
  if (constant_8 != NULL)
  {
    constant_8 = packed_string_integer_release_memory (constant_8);
  }   
  if (constant_9 != NULL)
  {
    constant_9 = packed_string_integer_release_memory (constant_9);
  }   
  if (constant_10 != NULL)
  {
    constant_10 = packed_string_integer_release_memory (constant_10);
  }   
// **************************************************************************************
// * Should not be any digit stack allocations anymore but release in case there are... *
// **************************************************************************************
  while (temp_digit_stack != NULL)
  {
    temp_digit_stack = pop_digit_stack (temp_digit_stack);
  }
  while (digit_stack != NULL)
  {
    digit_stack = pop_digit_stack (digit_stack);
  }
  return quotient_and_remainder;
}




psflt * _packed_string_float_add_both_numbers_same_sign (psflt *sum, psflt *num1, psflt *num2)
{
  psnc *temp_num1, *temp_num2, *temp_sum, *temp_number_block_right_of_decimal, *stop_block_num1, *stop_block_num2, *sum_left_of_decimal, *sum_right_of_decimal;
  unsigned char carry, num1_packed_byte, num2_packed_byte, num1_nibble_low, num2_nibble_low, num1_nibble_high, num2_nibble_high;
  unsigned char num1_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2], num2_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2];
  unsigned char done, found_all_zeros_right_of_decimal, sum_right_of_decimal_packed_digits[MAX_PACKED_NUMBER_BLOCK_SIZE];
  char sum_nibble_low, sum_nibble_high, sum_packed_byte;
  char sum_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2];
  long long int i, j, num1_highest_digit_position, num2_highest_digit_position, highest_digit_position;
  long long int sum_highest_digit_position;
  enum occupied_nibble sum_highest_nibble_position;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (sum != NULL)
  {
    sum = packed_string_float_component_release_memory (sum);
  }
  temp_num1            = NULL;
  temp_num2            = NULL;
  stop_block_num1      = NULL;
  stop_block_num2      = NULL;
  sum_left_of_decimal  = NULL;
  sum_right_of_decimal = NULL;
  carry = 0;
  if ((num1 != NULL) && (num2 != NULL))
  {
// ********************
// * RIGHT of DECIMAL *
// ********************
    if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal != NULL))
    {
      temp_num1 = num1->right_of_decimal;
      temp_num2 = num2->right_of_decimal;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// *                                                                                                                                  *
// * Now evenly interate over each number block for num1 and num2. We are trying to find out if num1 or num2 has more decimal digits. *
// ************************************************************************************************************************************
      while ((temp_num1->next_number_block != NULL) && (temp_num2->next_number_block != NULL)) 
      {
        temp_num1 = temp_num1->next_number_block;
        temp_num2 = temp_num2->next_number_block;
      }
      stop_block_num1 = temp_num1;
      stop_block_num2 = temp_num2;
      if (stop_block_num1->next_number_block != NULL)
      {
// **********************************************************************************************************
// * On Right of Decimal, num1 has more number blocks than num2.                                            *
// *                                                                                                        *
// * I must therefore process these blocks first since they represent the least significant digits of num1. *
// **********************************************************************************************************
        temp_num1 = num1->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
        while (temp_num1 != stop_block_num1)
        {
          if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
            {
              num1_right_of_decimal_unpacked_digits[i] = '*';
              num2_right_of_decimal_unpacked_digits[i] = '*';
              sum_right_of_decimal_unpacked_digits[i] = '*';
            }         
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              sum_right_of_decimal_packed_digits[i] = 0;
            }  
            j = 0;
            for (i = 0; i < temp_num1->highest_digit_position; i++)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            else
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
            }
            for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
            {
              if (num1_right_of_decimal_unpacked_digits[i] != '*')
              {
                sum_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] + carry;
                //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                {
                  sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
              }
            }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
            done = FALSE;
            sum_highest_nibble_position = lo;
            sum_highest_digit_position = 0;
            j = 0;
            for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
            {
              if (sum_right_of_decimal_unpacked_digits[i] != '*')
              {
                sum_nibble_high = 0;
                sum_nibble_low = sum_right_of_decimal_unpacked_digits[i];
                if (sum_right_of_decimal_unpacked_digits[i+1] != '*')
                {
                  sum_nibble_high = sum_right_of_decimal_unpacked_digits[i+1];
                  sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                    sum_highest_digit_position = j;
                    sum_highest_nibble_position = hi;
                    j++;
                  }
                }
                else
                {
                  sum_packed_byte = sum_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                    sum_highest_digit_position = j;
                    sum_highest_nibble_position = lo;
                    j++;
                  }
                }
              }
            } 
            sum_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (sum_right_of_decimal, &sum_right_of_decimal_packed_digits[0], sum_highest_digit_position, sum_highest_nibble_position);
            //printf ("sum_highest_nibble_position = ");
            //switch (sum_highest_nibble_position)
            //{
            //  case lo:
            //    printf ("lo");
            //  break;
            //  case hi:
            //    printf ("hi");
            //  break;
            //  default:
            //    printf ("unknown");
            //  break;
            //}
            //putchar ('\n');
            //printf ("num1_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (num1_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("num1_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (num1_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("sum_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (sum_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", sum_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("sum_right_of_decimal_packed_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            //{
            //  printf ("%02x", sum_right_of_decimal_packed_digits[i]);
            //}
            //putchar ('\n');
            //printf ("highest_digit_position (for sum_right_of_decimal_packed_digits) = %lld\n", sum_highest_digit_position);
            //printf ("sum_highest_nibble_position = ");
            //switch (sum_highest_nibble_position)
            //{
            //  case lo:
            //    printf ("lo");
            //  break;
            //  case hi:
            //    printf ("hi");
            //  break;
            //  default:
            //    printf ("unknown");
            //  break;
            //}
            //putchar ('\n');
            //putchar ('\n');
          }
          temp_num1 = temp_num1->previous_number_block;
        }
      }
      else
      {
        if (stop_block_num2->next_number_block != NULL)
        {
// **********************************************************************************************************
// * On Right of Decimal, num2 has more number blocks than num1.                                            *
// *                                                                                                        *
// * I must therefore process these blocks first since they represent the least significant digits of num2. *
// **********************************************************************************************************
          temp_num2 = num2->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
          while (temp_num2 != stop_block_num2)
          {
            if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
              {
                num1_right_of_decimal_unpacked_digits[i] = '*';
                num2_right_of_decimal_unpacked_digits[i] = '*';
                sum_right_of_decimal_unpacked_digits[i] = '*';
              }         
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                sum_right_of_decimal_packed_digits[i] = 0;
              }  
              j = 0;
              for (i = 0; i < temp_num2->highest_digit_position; i++)
              {
                num2_packed_byte = temp_num2->packed_number_block[i];
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              if (temp_num2->highest_nibble_position == hi)
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              else
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
              }
              for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
              {
                if (num2_right_of_decimal_unpacked_digits[i] != '*')
                {
                  sum_right_of_decimal_unpacked_digits[i] = num2_right_of_decimal_unpacked_digits[i] + carry;
                  //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num2_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                  if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                  {
                    sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                }
              }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
              done = FALSE;
              sum_highest_nibble_position = lo;
              sum_highest_digit_position = 0;
              j = 0;
              for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
              {
                if (sum_right_of_decimal_unpacked_digits[i] != '*')
                {
                  sum_nibble_high = 0;
                  sum_nibble_low = sum_right_of_decimal_unpacked_digits[i];
                  if (sum_right_of_decimal_unpacked_digits[i+1] != '*')
                  {
                    sum_nibble_high = sum_right_of_decimal_unpacked_digits[i+1];
                    sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                      sum_highest_digit_position = j;
                      sum_highest_nibble_position = hi;
                      j++;
                    }
                  }
                  else
                  {
                    sum_packed_byte = sum_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                      sum_highest_digit_position = j;
                      sum_highest_nibble_position = lo;
                      j++;
                    }
                  }
                }
              } 
              sum_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (sum_right_of_decimal, &sum_right_of_decimal_packed_digits[0], sum_highest_digit_position, sum_highest_nibble_position);
              //printf ("sum_highest_nibble_position = ");
              //switch (sum_highest_nibble_position)
              //{
              //  case lo:
              //    printf ("lo");
              //  break;
              //  case hi:
              //    printf ("hi");
              //  break;
              //  default:
              //    printf ("unknown");
              //  break;
              //}
              //putchar ('\n');
              //printf ("num2_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (num2_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("num2_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (num2_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("sum_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (sum_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", sum_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("sum_right_of_decimal_packed_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              //{
              //  printf ("%02x", sum_right_of_decimal_packed_digits[i]);
              //}
              //putchar ('\n');
              //printf ("highest_digit_position (for sum_right_of_decimal_packed_digits) = %lld\n", sum_highest_digit_position);
              //printf ("sum_highest_nibble_position = ");
              //switch (sum_highest_nibble_position)
              //{
              //  case lo:
              //    printf ("lo");
              //  break;
              //  case hi:
              //    printf ("hi");
              //  break;
              //  default:
              //    printf ("unknown");
              //  break;
              //}
              //putchar ('\n');
              //putchar ('\n');
            }
            temp_num2 = temp_num2->previous_number_block;
          }
        }
      }
    }
    if ((stop_block_num1 != NULL) && (stop_block_num2 != NULL))
    {
// ************************************************************************************************************************
// * At this point, num1 and num2 both have the same number of remaining number blocks to the right of the decimal point. *
// * Therefore, iterate over each number block and compute the sum.                                                *
// ************************************************************************************************************************
      temp_num1 = stop_block_num1;
      temp_num2 = stop_block_num2;
      while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
      {
        num1_highest_digit_position = temp_num1->highest_digit_position;
        num2_highest_digit_position = temp_num2->highest_digit_position;
        if ((num1_highest_digit_position >= 0) && (num1_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) && (num2_highest_digit_position >= 0) && (num2_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
// ***************************************************************************************************************************
// * Create a SUM buffer of unpacked digits to store the sum of the current blocks of digits. I purposefully initialize the  *
// * SUM buffer with a star (*) character because I know that character is outside the scope of valid base-10 digits (i.e.   *
// * zero through nine). I do this to ensure I can properly keep track of where the SUM digits end and to ensure the highest *
// * digit and highest nibble positions are preserved when repacking the digits.                                             *
// ***************************************************************************************************************************
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
          {
            num1_right_of_decimal_unpacked_digits[i] = '*';
            num2_right_of_decimal_unpacked_digits[i] = '*';
            sum_right_of_decimal_unpacked_digits[i]  = '*';
          }         
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            sum_right_of_decimal_packed_digits[i] = 0;
          }  
          j = 0;
          for (i = 0; i < num1_highest_digit_position; i++)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          else
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
          }
          j = 0;
          for (i = 0; i < num2_highest_digit_position; i++)
          {
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          num2_packed_byte = temp_num2->packed_number_block[i];
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          if (temp_num2->highest_nibble_position == hi)
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          else
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
          }
          done = FALSE;
          for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; (i >= 0) && (!done); i--)
          {
            if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
            {
              sum_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] + num2_right_of_decimal_unpacked_digits[i] + carry;
              //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] + num2_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d + %2d = %2d\n", i, i, i, num1_right_of_decimal_unpacked_digits[i], num2_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
              if (sum_right_of_decimal_unpacked_digits[i] >= 10)
              {
                sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
            }
            else
            {
              if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] == '*'))
              {
  	        sum_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] + carry;
                //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                {
                  sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
              }
              else
              {
                if ((num1_right_of_decimal_unpacked_digits[i] == '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
                {
  	          sum_right_of_decimal_unpacked_digits[i] = num2_right_of_decimal_unpacked_digits[i] + carry;
                  //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num2_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                  if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                  {
                    sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                }
              }
            }
          }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
          done = FALSE;
          sum_highest_nibble_position = lo;
          sum_highest_digit_position = 0;
          j = 0;
          for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
          {
            if (sum_right_of_decimal_unpacked_digits[i] != '*')
            {
              sum_nibble_high = 0;
              sum_nibble_low = sum_right_of_decimal_unpacked_digits[i];
              if (sum_right_of_decimal_unpacked_digits[i+1] != '*')
              {
                sum_nibble_high = sum_right_of_decimal_unpacked_digits[i+1];
                sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                  sum_highest_digit_position = j;
                  sum_highest_nibble_position = hi;
                  j++;
                }
              }
              else
              {
                sum_packed_byte = sum_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                  sum_highest_digit_position = j;
                  sum_highest_nibble_position = lo;
                  j++;
                }
              }
            }
          } 
          sum_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (sum_right_of_decimal, &sum_right_of_decimal_packed_digits[0], sum_highest_digit_position, sum_highest_nibble_position);
          //printf ("sum_highest_nibble_position = ");
          //switch (sum_highest_nibble_position)
          //{
          //  case lo:
          //    printf ("lo");
          //  break;
          //  case hi:
          //    printf ("hi");
          //  break;
          //  default:
          //    printf ("unknown");
          //  break;
          //}
          //putchar ('\n');
          //printf ("num1_right_of_decimal_unpacked_digits:\n");
          //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          //{
          //  if (num1_right_of_decimal_unpacked_digits[i] == '*')
          //  {
          //    putchar ('*');
          //  }
          //  else
          //  {
          //    printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
          //  }
          //}
          //putchar ('\n');
          //printf ("num2_right_of_decimal_unpacked_digits:\n");
          //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          //{
          //  if (num2_right_of_decimal_unpacked_digits[i] == '*')
          //  {
          //    putchar ('*');
          //  }
          //  else
          //  {
          //    printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
          //  }
          //}
          //putchar ('\n');
          //printf ("sum_right_of_decimal_unpacked_digits:\n");
          //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          //{
          //  if (sum_right_of_decimal_unpacked_digits[i] == '*')
          //  {
          //    putchar ('*');
          //  }
          //  else
          //  {
          //    printf ("%x", sum_right_of_decimal_unpacked_digits[i]);
          //  }
          //}
          //putchar ('\n');
          //printf ("sum_right_of_decimal_packed_digits:\n");
          //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          //{
          //  printf ("%02x", sum_right_of_decimal_packed_digits[i]);
          //}
          //putchar ('\n');
          //printf ("highest_digit_position (for sum_right_of_decimal_packed_digits) = %lld\n", sum_highest_digit_position);
          //printf ("sum_highest_nibble_position = ");
          //switch (sum_highest_nibble_position)
          //{
          //  case lo:
          //    printf ("lo");
          //  break;
          //  case hi:
          //    printf ("hi");
          //  break;
          //  default:
          //    printf ("unknown");
          //  break;
          //}
          //putchar ('\n');
          //putchar ('\n');
        }
        temp_num1 = temp_num1->previous_number_block;
        temp_num2 = temp_num2->previous_number_block;
      }
    }
    else
    {
      if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal == NULL))
      {
        temp_num1 = num1->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
        while (temp_num1 != NULL)
        {
          if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
            {
              num1_right_of_decimal_unpacked_digits[i] = '*';
              num2_right_of_decimal_unpacked_digits[i] = '*';
              sum_right_of_decimal_unpacked_digits[i] = '*';
            }         
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              sum_right_of_decimal_packed_digits[i] = 0;
            }  
            j = 0;
            for (i = 0; i < temp_num1->highest_digit_position; i++)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            else
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
            }
            for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
            {
              if (num1_right_of_decimal_unpacked_digits[i] != '*')
              {
                sum_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] + carry;
                //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                {
                  sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
              }
            }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
            done = FALSE;
            sum_highest_nibble_position = lo;
            sum_highest_digit_position = 0;
            j = 0;
            for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
            {
              if (sum_right_of_decimal_unpacked_digits[i] != '*')
              {
                sum_nibble_high = 0;
                sum_nibble_low = sum_right_of_decimal_unpacked_digits[i];
                if (sum_right_of_decimal_unpacked_digits[i+1] != '*')
                {
                  sum_nibble_high = sum_right_of_decimal_unpacked_digits[i+1];
                  sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                    sum_highest_digit_position = j;
                    sum_highest_nibble_position = hi;
                    j++;
                  }
                }
                else
                {
                  sum_packed_byte = sum_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                    sum_highest_digit_position = j;
                    sum_highest_nibble_position = lo;
                    j++;
                  }
                }
              }
            } 
            sum_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (sum_right_of_decimal, &sum_right_of_decimal_packed_digits[0], sum_highest_digit_position, sum_highest_nibble_position);
            //printf ("sum_highest_nibble_position = ");
            //switch (sum_highest_nibble_position)
            //{
            //  case lo:
            //    printf ("lo");
            //  break;
            //  case hi:
            //    printf ("hi");
            //  break;
            //  default:
            //    printf ("unknown");
            //  break;
            //}
            //putchar ('\n');
            //printf ("num1_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (num1_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("num1_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (num1_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("sum_right_of_decimal_unpacked_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
            //{
            //  if (sum_right_of_decimal_unpacked_digits[i] == '*')
            //  {
            //    putchar ('*');
            //  }
            //  else
            //  {
            //    printf ("%x", sum_right_of_decimal_unpacked_digits[i]);
            //  }
            //}
            //putchar ('\n');
            //printf ("sum_right_of_decimal_packed_digits:\n");
            //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            //{
            //  printf ("%02x", sum_right_of_decimal_packed_digits[i]);
            //}
            //putchar ('\n');
            //printf ("highest_digit_position (for sum_right_of_decimal_packed_digits) = %lld\n", sum_highest_digit_position);
            //printf ("sum_highest_nibble_position = ");
            //switch (sum_highest_nibble_position)
            //{
            //  case lo:
            //    printf ("lo");
            //  break;
            //  case hi:
            //    printf ("hi");
            //  break;
            //  default:
            //    printf ("unknown");
            //  break;
            //}
            //putchar ('\n');
            //putchar ('\n');
          }
          temp_num1 = temp_num1->previous_number_block;
        }
      }
      else
      {
        if ((num2->right_of_decimal != NULL) && (num1->right_of_decimal == NULL))
        {
          temp_num2 = num2->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
          while (temp_num2 != NULL)
          {
            if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
              {
                num1_right_of_decimal_unpacked_digits[i] = '*';
                num2_right_of_decimal_unpacked_digits[i] = '*';
                sum_right_of_decimal_unpacked_digits[i] = '*';
              }         
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                sum_right_of_decimal_packed_digits[i] = 0;
              }  
              j = 0;
              for (i = 0; i < temp_num2->highest_digit_position; i++)
              {
                num2_packed_byte = temp_num2->packed_number_block[i];
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              if (temp_num2->highest_nibble_position == hi)
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              else
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
              }
              for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
              {
                if (num2_right_of_decimal_unpacked_digits[i] != '*')
                {
                  sum_right_of_decimal_unpacked_digits[i] = num2_right_of_decimal_unpacked_digits[i] + carry;
                  //printf ("sum_right_of_decimal_unpacked_digits[%lld] = num2_right_of_decimal_unpacked_digits[%lld] + carry = %2d + %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], carry, sum_right_of_decimal_unpacked_digits[i]); 
                  if (sum_right_of_decimal_unpacked_digits[i] >= 10)
                  {
                    sum_right_of_decimal_unpacked_digits[i] = sum_right_of_decimal_unpacked_digits[i] - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                }
              }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
              done = FALSE;
              sum_highest_nibble_position = lo;
              sum_highest_digit_position = 0;
              j = 0;
              for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
              {
                if (sum_right_of_decimal_unpacked_digits[i] != '*')
                {
                  sum_nibble_high = 0;
                  sum_nibble_low = sum_right_of_decimal_unpacked_digits[i];
                  if (sum_right_of_decimal_unpacked_digits[i+1] != '*')
                  {
                    sum_nibble_high = sum_right_of_decimal_unpacked_digits[i+1];
                    sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                      sum_highest_digit_position = j;
                      sum_highest_nibble_position = hi;
                      j++;
                    }
                  }
                  else
                  {
                    sum_packed_byte = sum_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      sum_right_of_decimal_packed_digits[j] = sum_packed_byte;
                      sum_highest_digit_position = j;
                      sum_highest_nibble_position = lo;
                      j++;
                    }
                  }
                }
              } 
              sum_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (sum_right_of_decimal, &sum_right_of_decimal_packed_digits[0], sum_highest_digit_position, sum_highest_nibble_position);
              //printf ("sum_highest_nibble_position = ");
              //switch (sum_highest_nibble_position)
              //{
              //  case lo:
              //    printf ("lo");
              //  break;
              //  case hi:
              //    printf ("hi");
              //  break;
              //  default:
              //    printf ("unknown");
              //  break;
              //}
              //putchar ('\n');
              //printf ("num2_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (num2_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("num2_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (num2_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("sum_right_of_decimal_unpacked_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
              //{
              //  if (sum_right_of_decimal_unpacked_digits[i] == '*')
              //  {
              //    putchar ('*');
              //  }
              //  else
              //  {
              //    printf ("%x", sum_right_of_decimal_unpacked_digits[i]);
              //  }
              //}
              //putchar ('\n');
              //printf ("sum_right_of_decimal_packed_digits:\n");
              //for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              //{
              //  printf ("%02x", sum_right_of_decimal_packed_digits[i]);
              //}
              //putchar ('\n');
              //printf ("highest_digit_position (for sum_right_of_decimal_packed_digits) = %lld\n", sum_highest_digit_position);
              //printf ("sum_highest_nibble_position = ");
              //switch (sum_highest_nibble_position)
              //{
              //  case lo:
              //    printf ("lo");
              //  break;
              //  case hi:
              //    printf ("hi");
              //  break;
              //  default:
              //    printf ("unknown");
              //  break;
              //}
              //putchar ('\n');
              //putchar ('\n');
            }
            temp_num2 = temp_num2->previous_number_block;
          }
        }
      } 
    }
// **********************************************************************************************************************************************
// * Edge case: check if sum (Right of Decimal) is all zeros. If that's the case, then do not append any number blocks to the RIGHT of DECIMAL. *
// **********************************************************************************************************************************************
    found_all_zeros_right_of_decimal = TRUE;
    if (sum_right_of_decimal != NULL)
    {
      temp_sum = sum_right_of_decimal->first_number_block;
      while ((temp_sum != NULL) && found_all_zeros_right_of_decimal)
      {
        if ((temp_sum->highest_digit_position >= 0) && (temp_sum->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while ((i <= temp_sum->highest_digit_position) && found_all_zeros_right_of_decimal)
          {
            if (temp_sum->packed_number_block[i] > 0)
            {
              found_all_zeros_right_of_decimal = FALSE;
            }
            i++;
          }
        }
        temp_sum = temp_sum->next_number_block;
      }
      if (found_all_zeros_right_of_decimal)
      {
// *********************************************************
// * Release the memory for Right of Decimal number block. *
// *********************************************************
        temp_number_block_right_of_decimal = sum_right_of_decimal;
        while (sum_right_of_decimal != NULL)
        {
          temp_number_block_right_of_decimal = sum_right_of_decimal;
          sum_right_of_decimal = sum_right_of_decimal->next_number_block;
          free (temp_number_block_right_of_decimal);
        }
      }
    }
// *******************************************************************************************************************
// * LEFT of DECIMAL                                                                                                 *
// *                                                                                                                 *
// * Now that the SUM RIGHT of DECIMAL has been computed, it's time to begin the SUM LEFT of DECIMAL.                *
// * There's a possibility for a carry to be added to LEFT of DECIMAL as a result of the summation RIGHT of DECIMAL. *
// *******************************************************************************************************************
    temp_num1 = num1->left_of_decimal;
    temp_num2 = num2->left_of_decimal;
    while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
    {
      if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) &&
          (temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
      {
        if (temp_num1->highest_digit_position <= temp_num2->highest_digit_position)
        {
          highest_digit_position = temp_num1->highest_digit_position;
        }
        else
        {
          if (temp_num1->highest_digit_position > temp_num2->highest_digit_position)
          {
            highest_digit_position = temp_num2->highest_digit_position;
          }
        }
        i = 0;
        while (i < highest_digit_position)
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
          if (sum_nibble_low >= 10)
          {
            sum_nibble_low = sum_nibble_low - 10;
            carry = 1;
          }
          else
          {
            carry = 0;
          }
          sum_nibble_high = num1_nibble_high + num2_nibble_high + carry;
          if (sum_nibble_high >= 10)
          {
            sum_nibble_high = sum_nibble_high - 10;
            carry = 1;
          }
          else
          {
            carry = 0;
          }
          sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
          sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
          i++;
        }
// ***************************************************************************************
// * Now at the highest_digit_position: check num1's and num2's highest nibble position. *
// ***************************************************************************************
        if ((i == temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == hi))
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
            if (sum_nibble_low >= 10)
            {
              sum_nibble_low = sum_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_nibble_high = num1_nibble_high + num2_nibble_high + carry;
            if (sum_nibble_high >= 10)
            {
              sum_nibble_high = sum_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
            sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            i++;
          }
          else
          {
            if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == lo))
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num1_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
            else
            {
              if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == hi))
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (sum_nibble_low >= 10)
                {
                  sum_nibble_low = sum_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_nibble_high = num2_nibble_high + carry;
                if (sum_nibble_high >= 10)
                {
                  sum_nibble_high = sum_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                i++;
              }
              else
              {
                if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == lo))
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                  if (sum_nibble_low >= 10)
                  {
                    sum_nibble_low = sum_nibble_low - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  sum_packed_byte = sum_nibble_low;
                  sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                  i++;
                }
                else
                {
                  printf ("Internal infrastructure error: _packed_string_float_add_both_numbers_same_sign: right of decimal for num1 or num2 is undefined. Exiting now.\n");
                  exit (EXIT_FAILURE);
                }
              }
            }
          }       
        }
        else
        {
          if ((i == temp_num1->highest_digit_position) && (i < temp_num2->highest_digit_position))
          {
            num1_nibble_high = 0;
            num2_nibble_high = 0;
            num1_nibble_low  = 0;
            num2_nibble_low  = 0;
            num1_packed_byte = temp_num1->packed_number_block[i];
            num2_packed_byte = temp_num2->packed_number_block[i];
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num1_nibble_high + num2_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
            else
            {
              if (temp_num1->highest_nibble_position == lo)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (sum_nibble_low >= 10)
                {
                  sum_nibble_low = sum_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_nibble_high = num2_nibble_high + carry;
                if (sum_nibble_high >= 10)
                {
                  sum_nibble_high = sum_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                i++;
              }
            }
          }
          else
          {
            if ((i < temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
            {
              num1_nibble_high = 0;
              num2_nibble_high = 0;
              num1_nibble_low  = 0;
              num2_nibble_low  = 0;
              num1_packed_byte = temp_num1->packed_number_block[i];
              num2_packed_byte = temp_num2->packed_number_block[i];
              if (temp_num2->highest_nibble_position == hi)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (sum_nibble_low >= 10)
                {
                  sum_nibble_low = sum_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_nibble_high = num1_nibble_high + num2_nibble_high + carry;
                if (sum_nibble_high >= 10)
                {
                  sum_nibble_high = sum_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                i++;
              }
              else
              {
                if (temp_num2->highest_nibble_position == lo)
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  sum_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                  if (sum_nibble_low >= 10)
                  {
                    sum_nibble_low = sum_nibble_low - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  sum_nibble_high = num1_nibble_high + carry;
                  if (sum_nibble_high >= 10)
                  {
                    sum_nibble_high = sum_nibble_high - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
                  sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                  i++;
                }
              }       
            }
          }
        }
        if (i <= temp_num1->highest_digit_position)
        {
          while (i < temp_num1->highest_digit_position)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            sum_nibble_low = num1_nibble_low + carry;
            if (sum_nibble_low >= 10)
            {
              sum_nibble_low = sum_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_nibble_high = num1_nibble_high + carry;
            if (sum_nibble_high >= 10)
            {
              sum_nibble_high = sum_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
            sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            i++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = 0;
          num1_nibble_high = 0;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            sum_nibble_low = num1_nibble_low + carry;
            if (sum_nibble_low >= 10)
            {
              sum_nibble_low = sum_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_nibble_high = num1_nibble_high + carry;
            if (sum_nibble_high >= 10)
            {
              sum_nibble_high = sum_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
            sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              num1_nibble_low = num1_packed_byte & 0x0f;
              sum_nibble_low = num1_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            }
          }
        }
        else
        {
          if (i <= temp_num2->highest_digit_position)
          {
            while (i < temp_num2->highest_digit_position)
            {
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              sum_nibble_low = num2_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num2_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = 0;
            num2_nibble_high = 0;
            if (temp_num2->highest_nibble_position == hi)
            {
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              sum_nibble_low = num2_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num2_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                num2_nibble_low  = num2_packed_byte & 0x0f;
                sum_nibble_low = num2_nibble_low + carry;
                if (sum_nibble_low >= 10)
                {
                  sum_nibble_low = sum_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_packed_byte = sum_nibble_low;
                sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              }
            }
          }
        }
      }
      else
      {
        printf ("Internal infrastructure error: _packed_string_float_add_both_numbers_same_sign failed found highest_digit_position exceeds MAX_PACKED_NUMBER_BLOCK_SIZE size. Exiting now.\n");
        exit (EXIT_FAILURE);
      }
      temp_num1 = temp_num1->next_number_block;
      temp_num2 = temp_num2->next_number_block;
    }
// *****************************************************************************************************
// * num1 and num2 could be different lengths. If num1 or num2 end, I must copy the remaining contents * 
// * of the other number into the sum (result). I must also consider the carry as well.                *
// *****************************************************************************************************
    if (temp_num1 != NULL)
    {
      while (temp_num1 != NULL)
      {
        if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while (i < temp_num1->highest_digit_position)
          {
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            sum_nibble_low  = num1_nibble_low + carry;
            if (sum_nibble_low >= 10)
            {
              sum_nibble_low = sum_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_nibble_high = num1_nibble_high + carry;
            if (sum_nibble_high >= 10)
            {
              sum_nibble_high = sum_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
            sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            i++;
          }
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            sum_nibble_low  = num1_nibble_low + carry;
            if (sum_nibble_low >= 10)
            {
              sum_nibble_low = sum_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_nibble_high = num1_nibble_high + carry;
            if (sum_nibble_high >= 10)
            {
              sum_nibble_high = sum_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
            sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
            i++;
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              sum_nibble_low  = num1_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
          }
        }    
        temp_num1 = temp_num1->next_number_block;
      }
    }
    else
    {
      if (temp_num2 != NULL)
      {
        while (temp_num2 != NULL)
        {
          if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            i = 0;
            while (i < temp_num2->highest_digit_position)
            {
  // *************************************************************************
  // * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
  // * Unpack the bytes into lower and upper nibbles.                        *
  // *************************************************************************
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              sum_nibble_low  = num1_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num1_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
            if (temp_num2->highest_nibble_position == hi)
            {
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              sum_nibble_low  = num1_nibble_low + carry;
              if (sum_nibble_low >= 10)
              {
                sum_nibble_low = sum_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_nibble_high = num1_nibble_high + carry;
              if (sum_nibble_high >= 10)
              {
                sum_nibble_high = sum_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              sum_packed_byte = (sum_nibble_high << 4) + sum_nibble_low;
              sum_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
              i++;
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                num1_packed_byte = temp_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                sum_nibble_low = num1_nibble_low + carry;
                if (sum_nibble_low >= 10)
                {
                  sum_nibble_low = sum_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                sum_packed_byte = sum_nibble_low;
                sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
                i++;
              }
            }
          }    
          temp_num2 = temp_num2->next_number_block;
        }
      }
    }
    if (carry == 1)
    {
      sum_packed_byte = 1;
      sum_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (sum_left_of_decimal, sum_packed_byte);
    }
  } 
  if (sum == NULL)
  {
    sum = (psflt *) malloc(sizeof(psflt));
    if (sum != NULL)
    {
      sum->left_of_decimal = sum_left_of_decimal;
      sum->right_of_decimal = sum_right_of_decimal;
    }
  }
  return sum;
}




// **********************************************************************************************************
// * packed_string_float_add                                                                                *
// *                                                                                                        *
// * This is the main subroutine to call when adding two packed string-based integers.                      *
// * Upon success, a packed string-based floating-point number is returned. Upon failure, NULL is returned. *
// **********************************************************************************************************
psflt * packed_string_float_add (psflt *sum, psflt *num1, psflt *num2)
{
  psflt *temp_num1, *temp_num2;
  int sign_of_both_numbers_is_same, greater_number;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (sum != NULL)
  {
    sum = packed_string_float_component_release_memory (sum);
  }
  temp_num1 = NULL;
  temp_num2 = NULL;
  sign_of_both_numbers_is_same = FALSE;
  if ((num1 != NULL) && (num2 != NULL))
  {
    if (((num1->sign == positive) && (num2->sign == positive)) ||
        ((num1->sign == zero)     && (num2->sign == zero))     ||
        ((num1->sign == negative) && (num2->sign == negative)))
    {
      sign_of_both_numbers_is_same = TRUE;
    }
  }
  if (sign_of_both_numbers_is_same)
  {
// *************************************************************************************************************
// * No point iterating over two numbers if both numbers are zero. Make quick work and just assign sum a zero. *
// *************************************************************************************************************
    if (num1->sign != zero)
    {
      sum = _packed_string_float_add_both_numbers_same_sign (sum, num1, num2);
      sum->status_flag = 0;
    }
    else
    {
      sum = packed_string_float_initialize_to_zero (sum);
      sum->status_flag = 0;
    }
// *********************************************************************
// * Note: we already know that both input numbers have the same sign. *
// *********************************************************************
    sum->sign = num1->sign;
  }
  else
  {
// **************************************************************************************************************************
// * When one of the numbers is zero and the other number is positive, process the numbers exactly like same-sign addition. *
// **************************************************************************************************************************
    if (((num1->sign == positive) && (num2->sign == zero))      ||
        ((num1->sign == zero)     && (num2->sign == positive)))  
    {
      sum = _packed_string_float_add_both_numbers_same_sign (sum, num1, num2);
      sum->sign = positive;
      sum->status_flag = 0;
    }
    else
    {
// **************************************************************************************************************************
// * When one of the numbers is zero and the other number is negative, process the numbers exactly like same-sign addition. *
// **************************************************************************************************************************
      if (((num1->sign == zero)     && (num2->sign == negative)) ||
          ((num1->sign == negative) && (num2->sign == zero)))
      {
        sum = _packed_string_float_add_both_numbers_same_sign (sum, num1, num2);
        sum->sign = negative;
        sum->status_flag = 0;
      }
      else
      {
// ********************************************************************
// * One of the numbers is positive and the other number is negative. *
// ********************************************************************
        if ((num1->sign == negative) && (num2->sign == positive))
        {
          temp_num1 = packed_string_float_copy_number (temp_num1, num1);
          temp_num1 = packed_string_float_set_sign (temp_num1, positive);
          greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (temp_num1, num2);
          switch (greater_number)
          {
            case 1: // temp_num1 is greater than num2.
              sum = _packed_string_float_subtract_both_numbers_same_sign (sum, temp_num1, num2);
              sum = packed_string_float_set_sign (sum, negative); // Since num1 was originally negative, need to ensure sum (result) is negative.
              sum->status_flag = 0;
            break;
            case 0: // temp_num1 is equal to num2.
              sum = packed_string_float_initialize_to_zero (sum);
              sum->status_flag = 0;
            break;
            case -1: // temp_num1 is less than num2.
              sum = _packed_string_float_subtract_both_numbers_same_sign (sum, num2, temp_num1);
              sum = packed_string_float_set_sign (sum, positive); 
              sum->status_flag = 0;
            break;
            default:
              printf ("ERROR: stringfloat_determine_absolute_value_larger_of_two_integers returned an error.\n");
              exit (1);
            break;
          }
          temp_num1 = packed_string_float_component_release_memory (temp_num1);
        }
        else
        {
          if ((num1->sign == positive) && (num2->sign == negative))
          {
            temp_num2 = packed_string_float_copy_number (temp_num2, num2);
            temp_num2 = packed_string_float_set_sign (temp_num2, positive);
            greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, temp_num2);
            switch (greater_number)
            {
              case 1: // num1 is greater than temp_num2.
                sum = _packed_string_float_subtract_both_numbers_same_sign (sum, num1, temp_num2);
                sum = packed_string_float_set_sign (sum, positive); // Since num1 was originally positive, need to ensure sum (result) is positive.
                sum->status_flag = 0;
              break;
              case 0: // num1 is equal to temp_num2.
                sum = packed_string_float_initialize_to_zero (sum);
                sum->status_flag = 0;
              break;
              case -1: // num1 is less than temp_num2.
                sum = _packed_string_float_subtract_both_numbers_same_sign (sum, temp_num2, num1);
                sum = packed_string_float_set_sign (sum, negative); 
                sum->status_flag = 0;
              break;
              default:
                printf ("ERROR: stringfloat_determine_absolute_value_larger_of_two_integers returned an error.\n");
                exit (1);
              break;
            }   
            temp_num2 = packed_string_float_release_memory (temp_num2);
          }
        }
      }
    }
  }
  return sum;
}




// *****************************************************************************************************************************
// * _packed_string_float_subtract_both_nunbers_same_sign                                                                      *
// *                                                                                                                           *
// * This is an internal subroutine that should not be called directly. Instead, this subroutine should be called from within: *
// * packed_string_float_subtract_both_numbers_same sign                                                                       *
// *****************************************************************************************************************************
psflt * _packed_string_float_subtract_both_numbers_same_sign (psflt *difference, psflt *num1, psflt *num2)
{
  psnc *temp_num1, *temp_num2, *temp_difference, *temp_number_block_right_of_decimal, *stop_block_num1, *stop_block_num2, *difference_left_of_decimal, *difference_right_of_decimal;
  unsigned char borrow, packed_byte, nibble_high, nibble_low, num1_packed_byte, num2_packed_byte, num1_nibble_low, num2_nibble_low, num1_nibble_high, num2_nibble_high;
  unsigned char num1_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2], num2_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2];
  unsigned char done, internal_error_occurred, found_zero_digit, found_all_zeros_right_of_decimal, difference_right_of_decimal_packed_digits[MAX_PACKED_NUMBER_BLOCK_SIZE];
  char difference_nibble_low, difference_nibble_high, difference_packed_byte;
  char difference_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2];
  long long int i, j, num1_highest_digit_position, num2_highest_digit_position, highest_digit_position;
  long long int difference_highest_digit_position;
  enum occupied_nibble difference_highest_nibble_position;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (difference != NULL)
  {
    difference = packed_string_float_component_release_memory (difference);
  }
  temp_num1            = NULL;
  temp_num2            = NULL;
  stop_block_num1      = NULL;
  stop_block_num2      = NULL;
  difference_left_of_decimal  = NULL;
  difference_right_of_decimal = NULL;
  internal_error_occurred = FALSE;
  borrow = 0;
  if ((num1 != NULL) && (num2 != NULL))
  {
// ********************
// * RIGHT of DECIMAL *
// ********************
    if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal != NULL))
    {
      temp_num1 = num1->right_of_decimal;
      temp_num2 = num2->right_of_decimal;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// *                                                                                                                                  *
// * Now evenly interate over each number block for num1 and num2. We are trying to find out if num1 or num2 has more decimal digits. *
// ************************************************************************************************************************************
      while ((temp_num1->next_number_block != NULL) && (temp_num2->next_number_block != NULL)) 
      {
        temp_num1 = temp_num1->next_number_block;
        temp_num2 = temp_num2->next_number_block;
      }
      stop_block_num1 = temp_num1;
      stop_block_num2 = temp_num2;
      if (stop_block_num1->next_number_block != NULL)
      {
// **********************************************************************************************************
// * On Right of Decimal, num1 has more number blocks than num2.                                            *
// *                                                                                                        *
// * I must therefore process these blocks first since they represent the least significant digits of num1. *
// **********************************************************************************************************
        temp_num1 = num1->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
        while (temp_num1 != stop_block_num1)
        {
          if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
            {
              num1_right_of_decimal_unpacked_digits[i] = '*';
              num2_right_of_decimal_unpacked_digits[i] = '*';
              difference_right_of_decimal_unpacked_digits[i] = '*';
            }         
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              difference_right_of_decimal_packed_digits[i] = 0;
            }  
            j = 0;
            for (i = 0; i < temp_num1->highest_digit_position; i++)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            else
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
            }
            for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
            {
              if (num1_right_of_decimal_unpacked_digits[i] != '*')
              {
                difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - borrow;
                //printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - borrow = %2d - %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
                if (difference_right_of_decimal_unpacked_digits[i] < 0)
                {
                  difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
              }
            }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
            done = FALSE;
            difference_highest_nibble_position = lo;
            difference_highest_digit_position = 0;
            j = 0;
            for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
            {
              if (difference_right_of_decimal_unpacked_digits[i] != '*')
              {
                difference_nibble_high = 0;
                difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
                if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
                {
                  difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                  difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                    difference_highest_digit_position = j;
                    difference_highest_nibble_position = hi;
                    j++;
                  }
                }
                else
                {
                  difference_packed_byte = difference_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                    difference_highest_digit_position = j;
                    difference_highest_nibble_position = lo;
                    j++;
                  }
                }
              }
            } 
            difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
          }
          temp_num1 = temp_num1->previous_number_block;
        }
      }
      else
      {
        if (stop_block_num2->next_number_block != NULL)
        {
// **********************************************************************************************************
// * On Right of Decimal, num2 has more number blocks than num1.                                            *
// *                                                                                                        *
// * I must therefore process these blocks first since they represent the least significant digits of num2. *
// **********************************************************************************************************
          temp_num2 = num2->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
          while (temp_num2 != stop_block_num2)
          {
            if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
              {
                num1_right_of_decimal_unpacked_digits[i] = '*';
                num2_right_of_decimal_unpacked_digits[i] = '*';
                difference_right_of_decimal_unpacked_digits[i] = '*';
              }         
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                difference_right_of_decimal_packed_digits[i] = 0;
              }  
              j = 0;
              for (i = 0; i < temp_num2->highest_digit_position; i++)
              {
                num2_packed_byte = temp_num2->packed_number_block[i];
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              if (temp_num2->highest_nibble_position == hi)
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              else
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
              }
              for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
              {
                if (num2_right_of_decimal_unpacked_digits[i] != '*')
                {
                  difference_right_of_decimal_unpacked_digits[i] = 0 - num2_right_of_decimal_unpacked_digits[i] - borrow;
                  if (difference_right_of_decimal_unpacked_digits[i] < 0)
                  {
                    difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                }
              }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
              done = FALSE;
              difference_highest_nibble_position = lo;
              difference_highest_digit_position = 0;
              j = 0;
              for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
              {
                if (difference_right_of_decimal_unpacked_digits[i] != '*')
                {
                  difference_nibble_high = 0;
                  difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
                  if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
                  {
                    difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                    difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                      difference_highest_digit_position = j;
                      difference_highest_nibble_position = hi;
                      j++;
                    }
                  }
                  else
                  {
                    difference_packed_byte = difference_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                      difference_highest_digit_position = j;
                      difference_highest_nibble_position = lo;
                      j++;
                    }
                  }
                }
              } 
              difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
            }
            temp_num2 = temp_num2->previous_number_block;
          }
        }
      }
    }
    if ((stop_block_num1 != NULL) && (stop_block_num2 != NULL))
    {
// ************************************************************************************************************************
// * At this point, num1 and num2 both have the same number of remaining number blocks to the right of the decimal point. *
// * Therefore, iterate over each number block and compute the difference.                                                *
// ************************************************************************************************************************
      temp_num1 = stop_block_num1;
      temp_num2 = stop_block_num2;
      while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
      {
        num1_highest_digit_position = temp_num1->highest_digit_position;
        num2_highest_digit_position = temp_num2->highest_digit_position;
        if ((num1_highest_digit_position >= 0) && (num1_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) && (num2_highest_digit_position >= 0) && (num2_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
// **************************************************************************************************************************************
// * Create a SUM buffer of unpacked digits to store the difference of the current blocks of digits. I purposefully initialize the      *
// * DIFFFERENCE buffer with a star (*) character because I know that character is outside the scope of valid base-10 digits (i.e.      *
// * zero through nine). I do this to ensure I can properly keep track of where the difference digits end and ensure I know the highest *
// * digit and highest nibble position when repacking the digits.                                                                       *
// **************************************************************************************************************************************
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
          {
            num1_right_of_decimal_unpacked_digits[i] = '*';
            num2_right_of_decimal_unpacked_digits[i] = '*';
            difference_right_of_decimal_unpacked_digits[i]  = '*';
          }         
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            difference_right_of_decimal_packed_digits[i] = 0;
          }  
          j = 0;
          for (i = 0; i < num1_highest_digit_position; i++)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          else
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
          }
          j = 0;
          for (i = 0; i < num2_highest_digit_position; i++)
          {
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          num2_packed_byte = temp_num2->packed_number_block[i];
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          if (temp_num2->highest_nibble_position == hi)
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          else
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
          }
          done = FALSE;
          for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; (i >= 0) && (!done); i--)
          {
            if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
            {
              difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - num2_right_of_decimal_unpacked_digits[i] - borrow;
              //printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - num2_right_of_decimal_unpacked_digits[%lld] - borrow = %2d - %2d - %2d = %2d\n", i, i, i, num1_right_of_decimal_unpacked_digits[i], num2_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
              if (difference_right_of_decimal_unpacked_digits[i] < 0)
              {
                difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
            }
            else
            {
              if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] == '*'))
              {
  	        difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - borrow;
                //printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - borrow = %2d - %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
                if (difference_right_of_decimal_unpacked_digits[i] < 0)
                {
                  difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
              }
              else
              {
                if ((num1_right_of_decimal_unpacked_digits[i] == '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
                {
  	          difference_right_of_decimal_unpacked_digits[i] = 0 - num2_right_of_decimal_unpacked_digits[i] - borrow;
                  //printf ("difference_right_of_decimal_unpacked_digits[%lld] = 0 - num2_right_of_decimal_unpacked_digits[%lld] - borrow = 0 - %2d - %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
                  if (difference_right_of_decimal_unpacked_digits[i] < 0)
                  {
                    difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                }
              }
            }
          }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
          done = FALSE;
          difference_highest_nibble_position = lo;
          difference_highest_digit_position = 0;
          j = 0;
          for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
          {
            if (difference_right_of_decimal_unpacked_digits[i] != '*')
            {
              difference_nibble_high = 0;
              difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
              if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
              {
                difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                  difference_highest_digit_position = j;
                  difference_highest_nibble_position = hi;
                  j++;
                }
              }
              else
              {
                difference_packed_byte = difference_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                  difference_highest_digit_position = j;
                  difference_highest_nibble_position = lo;
                  j++;
                }
              }
            }
          } 
          difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
        }
        temp_num1 = temp_num1->previous_number_block;
        temp_num2 = temp_num2->previous_number_block;
      }
    }
    else
    {
      if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal == NULL))
      {
        temp_num1 = num1->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
        while (temp_num1 != NULL)
        {
          if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
            {
              num1_right_of_decimal_unpacked_digits[i] = '*';
              num2_right_of_decimal_unpacked_digits[i] = '*';
              difference_right_of_decimal_unpacked_digits[i] = '*';
            }         
            for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              difference_right_of_decimal_packed_digits[i] = 0;
            }  
            j = 0;
            for (i = 0; i < temp_num1->highest_digit_position; i++)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
              j++;
            }
            else
            {
              num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
              j++;
            }
            for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
            {
              if (num1_right_of_decimal_unpacked_digits[i] != '*')
              {
                difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - borrow;
                //printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - borrow = %2d - %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
                if (difference_right_of_decimal_unpacked_digits[i] < 0)
                {
                  difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
              }
            }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
            done = FALSE;
            difference_highest_nibble_position = lo;
            difference_highest_digit_position = 0;
            j = 0;
            for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
            {
              if (difference_right_of_decimal_unpacked_digits[i] != '*')
              {
                difference_nibble_high = 0;
                difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
                if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
                {
                  difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                  difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                    difference_highest_digit_position = j;
                    difference_highest_nibble_position = hi;
                    j++;
                  }
                }
                else
                {
                  difference_packed_byte = difference_nibble_low;
                  if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                  {
                    difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                    difference_highest_digit_position = j;
                    difference_highest_nibble_position = lo;
                    j++;
                  }
                }
              }
            } 
            difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
          }
          temp_num1 = temp_num1->previous_number_block;
        }
      }
      else
      {
        if ((num2->right_of_decimal != NULL) && (num1->right_of_decimal == NULL))
        {
          temp_num2 = num2->right_of_decimal->last_number_block;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// ************************************************************************************************************************************
          while (temp_num2 != NULL)
          {
            if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
              {
                num1_right_of_decimal_unpacked_digits[i] = '*';
                num2_right_of_decimal_unpacked_digits[i] = '*';
                difference_right_of_decimal_unpacked_digits[i] = '*';
              }         
              for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
              {
                difference_right_of_decimal_packed_digits[i] = 0;
              }  
              j = 0;
              for (i = 0; i < temp_num2->highest_digit_position; i++)
              {
                num2_packed_byte = temp_num2->packed_number_block[i];
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              if (temp_num2->highest_nibble_position == hi)
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
                j++;
              }
              else
              {
                num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
                j++;
              }
              for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; i >= 0; i--)
              {
                if (num2_right_of_decimal_unpacked_digits[i] != '*')
                {
                  difference_right_of_decimal_unpacked_digits[i] = 0 - num2_right_of_decimal_unpacked_digits[i] - borrow;
                  //printf ("difference_right_of_decimal_unpacked_digits[%lld] = 0 - num2_right_of_decimal_unpacked_digits[%lld] - borrow = %2d - %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], borrow, difference_right_of_decimal_unpacked_digits[i]); 
                  if (difference_right_of_decimal_unpacked_digits[i] < 0)
                  {
                    difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                }
              }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
              done = FALSE;
              difference_highest_nibble_position = lo;
              difference_highest_digit_position = 0;
              j = 0;
              for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
              {
                if (difference_right_of_decimal_unpacked_digits[i] != '*')
                {
                  difference_nibble_high = 0;
                  difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
                  if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
                  {
                    difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                    difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                      difference_highest_digit_position = j;
                      difference_highest_nibble_position = hi;
                      j++;
                    }
                  }
                  else
                  {
                    difference_packed_byte = difference_nibble_low;
                    if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                    {
                      difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                      difference_highest_digit_position = j;
                      difference_highest_nibble_position = lo;
                      j++;
                    }
                  }
                }
              } 
              difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
            }
            temp_num2 = temp_num2->previous_number_block;
          }
        }
      } 
    }
// *****************************************************************************************************************************************************
// * Edge case: check if difference (Right of Decimal) is all zeros. If that's the case, then do not append any number blocks to the RIGHT of DECIMAL. *
// *****************************************************************************************************************************************************
    found_all_zeros_right_of_decimal = TRUE;
    if (difference_right_of_decimal != NULL)
    {
      temp_difference = difference_right_of_decimal->first_number_block;
      while ((temp_difference != NULL) && found_all_zeros_right_of_decimal)
      {
        if ((temp_difference->highest_digit_position >= 0) && (temp_difference->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while ((i <= temp_difference->highest_digit_position) && found_all_zeros_right_of_decimal)
          {
            if (temp_difference->packed_number_block[i] > 0)
            {
              found_all_zeros_right_of_decimal = FALSE;
            }
            i++;
          }
        }
        temp_difference = temp_difference->next_number_block;
      }
      if (found_all_zeros_right_of_decimal)
      {
// *********************************************************
// * Release the memory for Right of Decimal number block. *
// *********************************************************
        temp_number_block_right_of_decimal = difference_right_of_decimal;
        while (difference_right_of_decimal != NULL)
        {
          temp_number_block_right_of_decimal = difference_right_of_decimal;
          difference_right_of_decimal = difference_right_of_decimal->next_number_block;
          free (temp_number_block_right_of_decimal);
        }
      }
    }
// *************************************************************************************************************************************
// * LEFT of DECIMAL                                                                                                                   *
// *                                                                                                                                   *
// * Now that the differencemation right of the decimal has been computed, it's time to begin computing difference on LEFT of DECIMAL. *
// * There's a possibility for a borrow to be subtracted from LEFT of DECIMAL as a result of the difference RIGHT of DECIMAL.          *
// *************************************************************************************************************************************
    temp_num1 = num1->left_of_decimal;
    temp_num2 = num2->left_of_decimal;
    while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
    {
      if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) &&
          (temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
      {
        if (temp_num1->highest_digit_position <= temp_num2->highest_digit_position)
        {
          highest_digit_position = temp_num1->highest_digit_position;
        }
        else
        {
          if (temp_num1->highest_digit_position > temp_num2->highest_digit_position)
          {
            highest_digit_position = temp_num2->highest_digit_position;
          }
        }
        i = 0;
        while (i < highest_digit_position)
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
          if (difference_nibble_low < 0)
          {
            difference_nibble_low = difference_nibble_low + 10;
            borrow = 1;
          }
          else
          {
            borrow = 0;
          }
          difference_nibble_high = num1_nibble_high - num2_nibble_high - borrow;
          if (difference_nibble_high < 0)
          {
            difference_nibble_high = difference_nibble_high + 10;
            borrow = 1;
          }
          else
          {
            borrow = 0;
          }
          difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
          difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
          i++;
        }
// ***************************************************************************************
// * Now at the highest_digit_position: check num1's and num2's highest nibble position. *
// ***************************************************************************************
        if ((i == temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == hi))
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
            if (difference_nibble_low < 0)
            {
              difference_nibble_low = difference_nibble_low + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_nibble_high = num1_nibble_high - num2_nibble_high - borrow;
            if (difference_nibble_high < 0)
            {
              difference_nibble_high = difference_nibble_high + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          else
          {
            if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == lo))
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num1_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == hi))
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
                if (difference_nibble_low < 0)
                {
                  difference_nibble_low = difference_nibble_low + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_nibble_high = num2_nibble_high - borrow;
                if (difference_nibble_high < 0)
                {
                  difference_nibble_high = difference_nibble_high + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
              else
              {
                if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == lo))
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
                  if (difference_nibble_low < 0)
                  {
                    difference_nibble_low = difference_nibble_low + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                  difference_packed_byte = difference_nibble_low;
                  difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                  i++;
                }
                else
                {
                  printf ("Internal infrastructure error: _packed_string_float_add_both_numbers_same_sign: right of decimal for num1 or num2 is undefined. Exiting now.\n");
                  exit (EXIT_FAILURE);
                }
              }
            }
          }       
        }
        else
        {
          if ((i == temp_num1->highest_digit_position) && (i < temp_num2->highest_digit_position))
          {
            num1_nibble_high = 0;
            num2_nibble_high = 0;
            num1_nibble_low  = 0;
            num2_nibble_low  = 0;
            num1_packed_byte = temp_num1->packed_number_block[i];
            num2_packed_byte = temp_num2->packed_number_block[i];
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num1_nibble_high - num2_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if (temp_num1->highest_nibble_position == lo)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
                if (difference_nibble_low < 0)
                {
                  difference_nibble_low = difference_nibble_low + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_nibble_high = num2_nibble_high - borrow;
                if (difference_nibble_high < 0)
                {
                  difference_nibble_high = difference_nibble_high + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
            }
          }
          else
          {
            if ((i < temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
            {
              num1_nibble_high = 0;
              num2_nibble_high = 0;
              num1_nibble_low  = 0;
              num2_nibble_low  = 0;
              num1_packed_byte = temp_num1->packed_number_block[i];
              num2_packed_byte = temp_num2->packed_number_block[i];
              if (temp_num2->highest_nibble_position == hi)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
                if (difference_nibble_low < 0)
                {
                  difference_nibble_low = difference_nibble_low + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_nibble_high = num1_nibble_high - num2_nibble_high - borrow;
                if (difference_nibble_high < 0)
                {
                  difference_nibble_high = difference_nibble_high + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
              else
              {
                if (temp_num2->highest_nibble_position == lo)
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  difference_nibble_low = num1_nibble_low - num2_nibble_low - borrow;
                  if (difference_nibble_low < 0)
                  {
                    difference_nibble_low = difference_nibble_low + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                  difference_nibble_high = num1_nibble_high - borrow;
                  if (difference_nibble_high < 0)
                  {
                    difference_nibble_high = difference_nibble_high + 10;
                    borrow = 1;
                  }
                  else
                  {
                    borrow = 0;
                  }
                  difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                  difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                  i++;
                }
              }       
            }
          }
        }
        if (i <= temp_num1->highest_digit_position)
        {
          while (i < temp_num1->highest_digit_position)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low - borrow;
            if (difference_nibble_low < 0)
            {
              difference_nibble_low = difference_nibble_low + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_nibble_high = num1_nibble_high - borrow;
            if (difference_nibble_high < 0)
            {
              difference_nibble_high = difference_nibble_high + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = 0;
          num1_nibble_high = 0;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low - borrow;
            if (difference_nibble_low < 0)
            {
              difference_nibble_low = difference_nibble_low + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_nibble_high = num1_nibble_high - borrow;
            if (difference_nibble_high < 0)
            {
              difference_nibble_high = difference_nibble_high + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              num1_nibble_low = num1_packed_byte & 0x0f;
              difference_nibble_low = num1_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            }
          }
        }
        else
        {
          if (i <= temp_num2->highest_digit_position)
          {
            while (i < temp_num2->highest_digit_position)
            {
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num2_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num2_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = 0;
            num2_nibble_high = 0;
            if (temp_num2->highest_nibble_position == hi)
            {
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num2_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num2_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                num2_nibble_low  = num2_packed_byte & 0x0f;
                difference_nibble_low = num2_nibble_low - borrow;
                if (difference_nibble_low < 0)
                {
                  difference_nibble_low = difference_nibble_low + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_packed_byte = difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              }
            }
          }
        }
      }
      else
      {
        printf ("Internal infrastructure error: _packed_string_float_subtract_both_numbers_same_sign failed found highest_digit_position exceeds MAX_PACKED_NUMBER_BLOCK_SIZE size. Exiting now.\n");
        exit (EXIT_FAILURE);
      }
      temp_num1 = temp_num1->next_number_block;
      temp_num2 = temp_num2->next_number_block;
    }
// *****************************************************************************************************
// * num1 and num2 could be different lengths. If num1 or num2 end, I must copy the remaining contents * 
// * of the other number into the difference (result). I also must consider a set borrow as well.      *
// *****************************************************************************************************
    if (temp_num1 != NULL)
    {
      while (temp_num1 != NULL)
      {
        if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while (i < temp_num1->highest_digit_position)
          {
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low  = num1_nibble_low - borrow;
            if (difference_nibble_low < 0)
            {
              difference_nibble_low = difference_nibble_low + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_nibble_high = num1_nibble_high - borrow;
            if (difference_nibble_high < 0)
            {
              difference_nibble_high = difference_nibble_high + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low  = num1_nibble_low - borrow;
            if (difference_nibble_low < 0)
            {
              difference_nibble_low = difference_nibble_low + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_nibble_high = num1_nibble_high - borrow;
            if (difference_nibble_high < 0)
            {
              difference_nibble_high = difference_nibble_high + 10;
              borrow = 1;
            }
            else
            {
              borrow = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              difference_nibble_low  = num1_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            }
          }
        }
        temp_num1 = temp_num1->next_number_block;
      }
    }
    else
    {
      if (temp_num2 != NULL)
      {
        while (temp_num2 != NULL)
        {
          if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            i = 0;
            while (i < temp_num2->highest_digit_position)
            {
  // *************************************************************************
  // * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
  // * Unpack the bytes into lower and upper nibbles.                        *
  // *************************************************************************
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              difference_nibble_low  = num1_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num1_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            if (temp_num2->highest_nibble_position == hi)
            {
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              difference_nibble_low  = num1_nibble_low - borrow;
              if (difference_nibble_low < 0)
              {
                difference_nibble_low = difference_nibble_low + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_nibble_high = num1_nibble_high - borrow;
              if (difference_nibble_high < 0)
              {
                difference_nibble_high = difference_nibble_high + 10;
                borrow = 1;
              }
              else
              {
                borrow = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                num1_packed_byte = temp_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                difference_nibble_low = num1_nibble_low - borrow;
                if (difference_nibble_low < 0)
                {
                  difference_nibble_low = difference_nibble_low + 10;
                  borrow = 1;
                }
                else
                {
                  borrow = 0;
                }
                difference_packed_byte = difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
            }
          }    
          temp_num2 = temp_num2->next_number_block;
        }
      }
    }
    if (borrow == 1)
    {
      difference_packed_byte = 1;
      difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
    }
  } 
// ***************************************************************************************************
// * Perform one last sanity check to make sure all is well. Specifically:                           *
// *                                                                                                 *
// * 1) check that there is at least one non-zero digit LEFT of DECIMAL                              *
// * 2) check that there is at least one non-zero digit RIGHT of DECIMAL                             *
// *                                                                                                 *
// * If there are only ZERO digits LEFT of DECIMAL, then set LEFT of DECIMAL to NULL.                *
// * If there are only ZERO digits RIGHT of DECIMAL, then set RIGHT of DECIMAL to NULL.              *
// * If there are only ZERO digits LEFT of DECIMAL AND RIGHT of DECIMAL then set difference to ZERO. *
// ***************************************************************************************************
  if (difference_left_of_decimal != NULL)
  {
    found_zero_digit = TRUE;
    temp_num1 = difference_left_of_decimal->last_number_block;
    while ((temp_num1 != NULL) && found_zero_digit)
    {
      if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
      {
        i = temp_num1->highest_digit_position;
        while ((i >= 0) && found_zero_digit)
        {      
          if (temp_num1->packed_number_block[i] > 0)
          {
            found_zero_digit = FALSE;
          }
          else
          {
            i--;
          }
        }
      }
      if (found_zero_digit)
      {
        temp_num1 = temp_num1->previous_number_block;
      }
    }
    if (found_zero_digit)
    {
      difference_left_of_decimal = packed_string_number_component_release_memory (difference_left_of_decimal);
    }
    else
    {
// ************************************************************************************************************************
// * A non-zero digit is found. Is the most significant digit a zero? If it is, remove it. Leading zeros are not allowed. *
// ************************************************************************************************************************
      if (temp_num1 != NULL)
      {
        if ((i >= 0) && (i < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          if (temp_num1->highest_nibble_position == hi)
          {
            nibble_high = (temp_num1->packed_number_block[i] & 0xf0) >> 4;
            nibble_low  = temp_num1->packed_number_block[i] & 0x0f;
            if (nibble_high == 0)
            {
              if (nibble_low > 0)
              {
                temp_num1->highest_nibble_position = lo;
              }
              else
              {
                if (i == 0)
                {
                  difference_left_of_decimal = packed_string_number_component_release_memory (difference_left_of_decimal);
                }
                else
                {
                  internal_error_occurred = TRUE;
                }
              }
            }
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              nibble_low  = temp_num1->packed_number_block[i] & 0x0f;
              if (nibble_low == 0)
              {
                if (i == 0)
                {
                  difference_left_of_decimal = packed_string_number_component_release_memory (difference_left_of_decimal);
                }
                else
                {
                  internal_error_occurred = TRUE;
                }
              }
            }
          }
        }
        else
        {
          internal_error_occurred = TRUE;
        }       
      }
    }
  }
  if (!internal_error_occurred)
  {
    if (difference_right_of_decimal != NULL)
    {
      found_zero_digit = TRUE;
      temp_num1 = difference_right_of_decimal; // Digits RIGHT of DECIMAL are in reverse order compared to LEFT of DECIMAL. The most significiant digit (RIGHT of DECIMAL) is immediately RIGHT of decimal.
      while ((temp_num1 != NULL) && found_zero_digit)
      {
        if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = temp_num1->highest_digit_position;
          while ((i >= 0) && found_zero_digit)
          {      
            if (temp_num1->packed_number_block[i] > 0)
            {
              found_zero_digit = FALSE;
            }
            else
            {
              i--;
            }
          }
        }
        if (found_zero_digit)
        {
          temp_num1 = temp_num1->next_number_block;
        }
      }
      if (found_zero_digit)
      {
        difference_right_of_decimal = packed_string_number_component_release_memory (difference_right_of_decimal);
      }
    }
  }
  if (internal_error_occurred)
  {
    difference_left_of_decimal = packed_string_number_component_release_memory (difference_left_of_decimal);
    difference_right_of_decimal = packed_string_number_component_release_memory (difference_left_of_decimal);
    if (difference == NULL)
    {
      difference = (psflt *) malloc(sizeof(psflt));
      if (difference != NULL)
      {
        difference->sign = undefined;
        difference->left_of_decimal  = NULL;
        difference->right_of_decimal = NULL;
        difference->status_flag = INTERNAL_ERROR;
      }
    }
  }
  else
  {
    if (difference == NULL)
    {
      if ((difference_left_of_decimal == NULL) && (difference_right_of_decimal == NULL))
      {
        difference = packed_string_float_initialize_to_zero (difference);
      }
      else
      {
        difference = (psflt *) malloc(sizeof(psflt));
        if (difference != NULL)
        {
          difference->left_of_decimal = difference_left_of_decimal;
          difference->right_of_decimal = difference_right_of_decimal;
          difference->status_flag = NONE;
        }
      }
    }
  }
  return difference;
}




psflt * _packed_string_float_subtract_both_numbers_same_sign_v2 (psflt *difference, psflt *num1, psflt *num2)
{
  psnc *temp_num1, *temp_num2, *temp_difference, *temp_number_block_right_of_decimal, *stop_block_num1, *stop_block_num2, *difference_left_of_decimal, *difference_right_of_decimal;
  unsigned char carry, num1_packed_byte, num2_packed_byte, num1_nibble_low, num2_nibble_low, num1_nibble_high, num2_nibble_high, difference_nibble_low, difference_nibble_high, difference_packed_byte;
  unsigned char num1_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2], num2_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2];
  unsigned char difference_right_of_decimal_unpacked_digits[MAX_PACKED_NUMBER_BLOCK_SIZE*2], difference_right_of_decimal_packed_digits[MAX_PACKED_NUMBER_BLOCK_SIZE];
  unsigned char done, found_all_zeros_right_of_decimal;
  long long int i, j, num1_highest_digit_position, num2_highest_digit_position, highest_digit_position;
  long long int difference_highest_digit_position;
  enum occupied_nibble difference_highest_nibble_position;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (difference != NULL)
  {
    difference = packed_string_float_component_release_memory (difference);
  }
  temp_num1            = NULL;
  temp_num2            = NULL;
  stop_block_num1      = NULL;
  stop_block_num2      = NULL;
  difference_left_of_decimal  = NULL;
  difference_right_of_decimal = NULL;
  carry = 0;
  if ((num1 != NULL) && (num2 != NULL))
  {
// ********************
// * RIGHT of DECIMAL *
// ********************
    if ((num1->right_of_decimal != NULL) && (num2->right_of_decimal != NULL))
    {
      temp_num1 = num1->right_of_decimal;
      temp_num2 = num2->right_of_decimal;
// ************************************************************************************************************************************
// * On the right of the decimal, the least significant digit is in the lowest digit position (zero) in the highest number block.     *
// *                                                                                                                                  *
// * Now evenly interate over each number block for num1 and num2. We are trying to find out if num1 or num2 has more decimal digits. *
// ************************************************************************************************************************************
      while ((temp_num1->next_number_block != NULL) && (temp_num2->next_number_block != NULL)) 
      {
        temp_num1 = temp_num1->next_number_block;
        temp_num2 = temp_num2->next_number_block;
      }
      stop_block_num1 = temp_num1;
      stop_block_num2 = temp_num2;
    }
    if ((stop_block_num1 != NULL) && (stop_block_num2 != NULL))
    {
// ************************************************************************************************************************
// * At this point, num1 and num2 both have the same number of remaining number blocks to the right of the decimal point. *
// * Therefore, iterate over each number block and compute the differencemation.                                                 *
// ************************************************************************************************************************
      temp_num1 = stop_block_num1;
      temp_num2 = stop_block_num2;
      while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
      {
        num1_highest_digit_position = temp_num1->highest_digit_position;
        num2_highest_digit_position = temp_num2->highest_digit_position;
        if ((num1_highest_digit_position >= 0) && (num1_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) && (num2_highest_digit_position >= 0) && (num2_highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
// *****************************************************************************************************************************
// * Create a SUM buffer of unpacked digits to store the difference of the current blocks of digits. I purposefully initialize the    *
// * SUM buffer with a star (*) character because I know that character is outside the scope of valid base-10 digits (i.e.     *
// * zero through nine). I do this to ensure I can properly keep track of where the difference digits end and ensure know the highest *
// * digit and highest nibble position (when repacking the digits).                                                            *
// *****************************************************************************************************************************
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE*2; i++)
          {
            num1_right_of_decimal_unpacked_digits[i] = '*';
            num2_right_of_decimal_unpacked_digits[i] = '*';
            difference_right_of_decimal_unpacked_digits[i]  = '*';
          }         
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            difference_right_of_decimal_packed_digits[i] = 0;
          }  
          j = 0;
          for (i = 0; i < num1_highest_digit_position; i++)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_high;
            j++;
          }
          else
          {
            num1_right_of_decimal_unpacked_digits[j] = num1_nibble_low;
            j++;
          }
          j = 0;
          for (i = 0; i < num2_highest_digit_position; i++)
          {
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          num2_packed_byte = temp_num2->packed_number_block[i];
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          if (temp_num2->highest_nibble_position == hi)
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_high;
            j++;
          }
          else
          {
            num2_right_of_decimal_unpacked_digits[j] = num2_nibble_low;
            j++;
          }
          done = FALSE;
          for (i = MAX_PACKED_NUMBER_BLOCK_SIZE*2-1; (i >= 0) && (!done); i--)
          {
            if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
            {
              difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - num2_right_of_decimal_unpacked_digits[i] - carry;
              printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - num2_right_of_decimal_unpacked_digits[%lld] - carry = %2d - %2d - %2d = %2d\n", i, i, i, num1_right_of_decimal_unpacked_digits[i], num2_right_of_decimal_unpacked_digits[i], carry, difference_right_of_decimal_unpacked_digits[i]); 
              if (difference_right_of_decimal_unpacked_digits[i] >= 10)
              {
                difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
            }
            else
            {
              if ((num1_right_of_decimal_unpacked_digits[i] != '*') && (num2_right_of_decimal_unpacked_digits[i] == '*'))
              {
  	        difference_right_of_decimal_unpacked_digits[i] = num1_right_of_decimal_unpacked_digits[i] - carry;
                printf ("difference_right_of_decimal_unpacked_digits[%lld] = num1_right_of_decimal_unpacked_digits[%lld] - carry = %2d - %2d = %2d\n", i, i, num1_right_of_decimal_unpacked_digits[i], carry, difference_right_of_decimal_unpacked_digits[i]); 
                if (difference_right_of_decimal_unpacked_digits[i] >= 10)
                {
                  difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
              }
              else
              {
                if ((num1_right_of_decimal_unpacked_digits[i] == '*') && (num2_right_of_decimal_unpacked_digits[i] != '*'))
                {
  	          difference_right_of_decimal_unpacked_digits[i] = num2_right_of_decimal_unpacked_digits[i] - carry;
                  printf ("difference_right_of_decimal_unpacked_digits[%lld] = num2_right_of_decimal_unpacked_digits[%lld] - carry = %2d - %2d = %2d\n", i, i, num2_right_of_decimal_unpacked_digits[i], carry, difference_right_of_decimal_unpacked_digits[i]); 
                  if (difference_right_of_decimal_unpacked_digits[i] >= 10)
                  {
                    difference_right_of_decimal_unpacked_digits[i] = difference_right_of_decimal_unpacked_digits[i] - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                }
                else
                {
                  if (carry > 0)
                  {
  	            difference_right_of_decimal_unpacked_digits[i] = carry;
                  }
                }
              }
            }
          }
// *********************************************************************************************************
// * Now copy the unpacked digits right of decimal into a packed array (packed means two digits per byte). *
// *********************************************************************************************************
          done = FALSE;
          difference_highest_nibble_position = lo;
          difference_highest_digit_position = 0;
          j = 0;
          for (i = 0; i < ((MAX_PACKED_NUMBER_BLOCK_SIZE * 2) - 1); i = i + 2)
          {
            if (difference_right_of_decimal_unpacked_digits[i] != '*')
            {
              difference_nibble_high = 0;
              difference_nibble_low = difference_right_of_decimal_unpacked_digits[i];
              if (difference_right_of_decimal_unpacked_digits[i+1] != '*')
              {
                difference_nibble_high = difference_right_of_decimal_unpacked_digits[i+1];
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                  difference_highest_digit_position = j;
                  difference_highest_nibble_position = hi;
                  j++;
                }
              }
              else
              {
                difference_packed_byte = difference_nibble_low;
                if (j < MAX_PACKED_NUMBER_BLOCK_SIZE)
                {
                  difference_right_of_decimal_packed_digits[j] = difference_packed_byte;
                  difference_highest_digit_position = j;
                  difference_highest_nibble_position = lo;
                  j++;
                }
              }
            }
          } 
          difference_right_of_decimal = packed_string_float_append_number_block_right_of_decimal_in_stack_order (difference_right_of_decimal, &difference_right_of_decimal_packed_digits[0], difference_highest_digit_position, difference_highest_nibble_position);
          printf ("difference_highest_nibble_position = ");
          switch (difference_highest_nibble_position)
          {
            case lo:
              printf ("lo");
            break;
            case hi:
              printf ("hi");
            break;
            default:
              printf ("unknown");
            break;
          }
          putchar ('\n');
          printf ("num1_right_of_decimal_unpacked_digits:\n");
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          {
            if (num1_right_of_decimal_unpacked_digits[i] == '*')
            {
              putchar ('*');
            }
            else
            {
              printf ("%x", num1_right_of_decimal_unpacked_digits[i]);
            }
          }
          putchar ('\n');
          printf ("num2_right_of_decimal_unpacked_digits:\n");
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          {
            if (num2_right_of_decimal_unpacked_digits[i] == '*')
            {
              putchar ('*');
            }
            else
            {
              printf ("%x", num2_right_of_decimal_unpacked_digits[i]);
            }
          }
          putchar ('\n');
          printf ("difference_right_of_decimal_unpacked_digits:\n");
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE * 2; i++)
          {
            if (difference_right_of_decimal_unpacked_digits[i] == '*')
            {
              putchar ('*');
            }
            else
            {
              printf ("%x", difference_right_of_decimal_unpacked_digits[i]);
            }
          }
          putchar ('\n');
          printf ("difference_right_of_decimal_packed_digits:\n");
          for (i = 0; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
          {
            printf ("%02x", difference_right_of_decimal_packed_digits[i]);
          }
          putchar ('\n');
          printf ("highest_digit_position (for difference_right_of_decimal_packed_digits) = %lld\n", difference_highest_digit_position);
          printf ("difference_highest_nibble_position = ");
          switch (difference_highest_nibble_position)
          {
            case lo:
              printf ("lo");
            break;
            case hi:
              printf ("hi");
            break;
            default:
              printf ("unknown");
            break;
          }
          putchar ('\n');
          putchar ('\n');
        }
        temp_num1 = temp_num1->previous_number_block;
        temp_num2 = temp_num2->previous_number_block;
      }
// *********************************************************************************************************
// * When differenceming floating point numbers, I must first determine which number (num1 or num2) contains more *
// * more digits to the right of the decimal. If num1 has more digits than num2, then copy all num1 digits *
// * to difference (since num2 would be zeros). Then begin adding num1 and num2 when num2's block of digits       *
// * begin.                                                                                                *                       
// *********************************************************************************************************
      temp_num1 = stop_block_num1;
      temp_num2 = stop_block_num2;
      if (temp_num1->next_number_block != NULL)
      {
        temp_num1 = num1->right_of_decimal->last_number_block;
        while (temp_num1 != stop_block_num1)
        {
          i = 0;
          while (i <= temp_num1->highest_digit_position)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            difference_right_of_decimal = packed_string_float_append_two_digits_right_of_decimal (difference_right_of_decimal, num1_packed_byte);
            i++;
          }
          temp_num1 = temp_num1->previous_number_block;
        }
      }
      else
      {
        if (temp_num2->next_number_block != NULL)
        {
          temp_num2 = num2->right_of_decimal->last_number_block;
          while (temp_num2 != stop_block_num2)
          {
            i = 0;
            while (i <= temp_num2->highest_digit_position)
            {
              num2_packed_byte = temp_num2->packed_number_block[i];
              difference_right_of_decimal = packed_string_float_append_two_digits_right_of_decimal (difference_right_of_decimal, num2_packed_byte);
              i++;
            }
            temp_num2 = temp_num2->previous_number_block;
          }
        }
      }
    }
// ********************
// * LEFT of DECIMAL *
// ********************

// *******************************************************************************************************************
// * Now that the differencemation right of the decimal has been computed, it's time to begin differencemation on LEFT of DECIMAL. *
// * There's a possibility for a carry to be added to LEFT of DECIMAL as a result of the differencemation RIGHT of DECIMAL. *                                                     
// *******************************************************************************************************************
    temp_num1 = num1->left_of_decimal;
    temp_num2 = num2->left_of_decimal;
    while ((temp_num1 != NULL) && (temp_num2 != NULL)) 
    {
      if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE) &&
          (temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
      {
        if (temp_num1->highest_digit_position <= temp_num2->highest_digit_position)
        {
          highest_digit_position = temp_num1->highest_digit_position;
        }
        else
        {
          if (temp_num1->highest_digit_position > temp_num2->highest_digit_position)
          {
            highest_digit_position = temp_num2->highest_digit_position;
          }
        }
        i = 0;
        while (i < highest_digit_position)
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          num1_nibble_low  = num1_packed_byte & 0x0f;
          num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
          num2_nibble_low  = num2_packed_byte & 0x0f;
          num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
          difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
          if (difference_nibble_low >= 10)
          {
            difference_nibble_low = difference_nibble_low - 10;
            carry = 1;
          }
          else
          {
            carry = 0;
          }
          difference_nibble_high = num1_nibble_high + num2_nibble_high + carry;
          if (difference_nibble_high >= 10)
          {
            difference_nibble_high = difference_nibble_high - 10;
            carry = 1;
          }
          else
          {
            carry = 0;
          }
          difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
          difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
          i++;
        }
// ***************************************************************************************
// * Now at the highest_digit_position: check num1's and num2's highest nibble position. *
// ***************************************************************************************
        if ((i == temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
        {
          num1_nibble_high = 0;
          num2_nibble_high = 0;
          num1_nibble_low  = 0;
          num2_nibble_low  = 0;
          num1_packed_byte = temp_num1->packed_number_block[i];
          num2_packed_byte = temp_num2->packed_number_block[i];
          if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == hi))
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            num2_nibble_low  = num2_packed_byte & 0x0f;
            num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
            if (difference_nibble_low >= 10)
            {
              difference_nibble_low = difference_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_nibble_high = num1_nibble_high + num2_nibble_high + carry;
            if (difference_nibble_high >= 10)
            {
              difference_nibble_high = difference_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          else
          {
            if ((temp_num1->highest_nibble_position == hi) && (temp_num2->highest_nibble_position == lo))
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num1_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == hi))
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (difference_nibble_low >= 10)
                {
                  difference_nibble_low = difference_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_nibble_high = num2_nibble_high + carry;
                if (difference_nibble_high >= 10)
                {
                  difference_nibble_high = difference_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
              else
              {
                if ((temp_num1->highest_nibble_position == lo) && (temp_num2->highest_nibble_position == lo))
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                  if (difference_nibble_low >= 10)
                  {
                    difference_nibble_low = difference_nibble_low - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  difference_packed_byte = difference_nibble_low;
                  difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                  i++;
                }
                else
                {
                  printf ("Internal infrastructure error: _packed_string_float_add_both_numbers_same_sign: right of decimal for num1 or num2 is undefined. Exiting now.\n");
                  exit (EXIT_FAILURE);
                }
              }
            }
          }       
        }
        else
        {
          if ((i == temp_num1->highest_digit_position) && (i < temp_num2->highest_digit_position))
          {
            num1_nibble_high = 0;
            num2_nibble_high = 0;
            num1_nibble_low  = 0;
            num2_nibble_low  = 0;
            num1_packed_byte = temp_num1->packed_number_block[i];
            num2_packed_byte = temp_num2->packed_number_block[i];
            if (temp_num1->highest_nibble_position == hi)
            {
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num1_nibble_high + num2_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if (temp_num1->highest_nibble_position == lo)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (difference_nibble_low >= 10)
                {
                  difference_nibble_low = difference_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_nibble_high = num2_nibble_high + carry;
                if (difference_nibble_high >= 10)
                {
                  difference_nibble_high = difference_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
            }
          }
          else
          {
            if ((i < temp_num1->highest_digit_position) && (i == temp_num2->highest_digit_position))
            {
              num1_nibble_high = 0;
              num2_nibble_high = 0;
              num1_nibble_low  = 0;
              num2_nibble_low  = 0;
              num1_packed_byte = temp_num1->packed_number_block[i];
              num2_packed_byte = temp_num2->packed_number_block[i];
              if (temp_num2->highest_nibble_position == hi)
              {
                num1_nibble_low  = num1_packed_byte & 0x0f;
                num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                num2_nibble_low  = num2_packed_byte & 0x0f;
                num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
                difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                if (difference_nibble_low >= 10)
                {
                  difference_nibble_low = difference_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_nibble_high = num1_nibble_high + num2_nibble_high + carry;
                if (difference_nibble_high >= 10)
                {
                  difference_nibble_high = difference_nibble_high - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
              else
              {
                if (temp_num2->highest_nibble_position == lo)
                {
                  num1_nibble_low  = num1_packed_byte & 0x0f;
                  num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
                  num2_nibble_low  = num2_packed_byte & 0x0f;
                  difference_nibble_low = num1_nibble_low + num2_nibble_low + carry;
                  if (difference_nibble_low >= 10)
                  {
                    difference_nibble_low = difference_nibble_low - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  difference_nibble_high = num1_nibble_high + carry;
                  if (difference_nibble_high >= 10)
                  {
                    difference_nibble_high = difference_nibble_high - 10;
                    carry = 1;
                  }
                  else
                  {
                    carry = 0;
                  }
                  difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
                  difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                  i++;
                }
              }       
            }
          }
        }
        if (i < temp_num1->highest_digit_position)
        {
          while (i < temp_num1->highest_digit_position)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low + carry;
            if (difference_nibble_low >= 10)
            {
              difference_nibble_low = difference_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_nibble_high = num1_nibble_high + carry;
            if (difference_nibble_high >= 10)
            {
              difference_nibble_high = difference_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          num1_packed_byte = temp_num1->packed_number_block[i];
          num1_nibble_low  = 0;
          num1_nibble_high = 0;
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low = num1_nibble_low + carry;
            if (difference_nibble_low >= 10)
            {
              difference_nibble_low = difference_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_nibble_high = num1_nibble_high + carry;
            if (difference_nibble_high >= 10)
            {
              difference_nibble_high = difference_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              difference_nibble_low = num1_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            }
          }
        }
        else
        {
          if (i < temp_num2->highest_digit_position)
          {
            while (i < temp_num2->highest_digit_position)
            {
              num2_packed_byte = temp_num2->packed_number_block[i];
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num2_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num2_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            num2_packed_byte = temp_num2->packed_number_block[i];
            num2_nibble_low  = 0;
            num2_nibble_high = 0;
            if (temp_num2->highest_nibble_position == hi)
            {
              num2_nibble_low  = num2_packed_byte & 0x0f;
              num2_nibble_high = (num2_packed_byte & 0xf0) >> 4;
              difference_nibble_low = num2_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num2_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                difference_nibble_low = num2_nibble_low + carry;
                if (difference_nibble_low >= 10)
                {
                  difference_nibble_low = difference_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_packed_byte = difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              }
            }
          }
        }
      }
      else
      {
        printf ("Internal infrastructure error: _packed_string_float_add_both_numbers_same_sign failed found highest_digit_position exceeds MAX_PACKED_NUMBER_BLOCK_SIZE size. Exiting now.\n");
        exit (EXIT_FAILURE);
      }
      temp_num1 = temp_num1->next_number_block;
      temp_num2 = temp_num2->next_number_block;
    }
// ********************************************************************************************
// * num1 and num2 could be different lengths. If num1 or num2 end, I must copy the remaining *
// * contents of the other number into the difference (result). I also must consider a set carry as  *
// * well.                                                                                    *
// ********************************************************************************************
    if (temp_num1 != NULL)
    {
      while (temp_num1 != NULL)
      {
        if ((temp_num1->highest_digit_position >= 0) && (temp_num1->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while (i < temp_num1->highest_digit_position)
          {
// *************************************************************************
// * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
// * Unpack the bytes into lower and upper nibbles.                        *
// *************************************************************************
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low  = num1_nibble_low + carry;
            if (difference_nibble_low >= 10)
            {
              difference_nibble_low = difference_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_nibble_high = num1_nibble_high + carry;
            if (difference_nibble_high >= 10)
            {
              difference_nibble_high = difference_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          if (temp_num1->highest_nibble_position == hi)
          {
            num1_packed_byte = temp_num1->packed_number_block[i];
            num1_nibble_low  = num1_packed_byte & 0x0f;
            num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
            difference_nibble_low  = num1_nibble_low + carry;
            if (difference_nibble_low >= 10)
            {
              difference_nibble_low = difference_nibble_low - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_nibble_high = num1_nibble_high + carry;
            if (difference_nibble_high >= 10)
            {
              difference_nibble_high = difference_nibble_high - 10;
              carry = 1;
            }
            else
            {
              carry = 0;
            }
            difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
            difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
            i++;
          }
          else
          {
            if (temp_num1->highest_nibble_position == lo)
            {
              num1_packed_byte = temp_num1->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              difference_nibble_low  = num1_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
          }
        }    
        temp_num1 = temp_num1->next_number_block;
      }
    }
    else
    {
      if (temp_num2 != NULL)
      {
        while (temp_num2 != NULL)
        {
          if ((temp_num2->highest_digit_position >= 0) && (temp_num2->highest_digit_position <= MAX_PACKED_NUMBER_BLOCK_SIZE))
          {
            i = 0;
            while (i < temp_num2->highest_digit_position)
            {
  // *************************************************************************
  // * Two Binary Coded Decimal (BCD) 4-bit digits are packed in each byte.  *
  // * Unpack the bytes into lower and upper nibbles.                        *
  // *************************************************************************
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              difference_nibble_low  = num1_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num1_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            if (temp_num2->highest_nibble_position == hi)
            {
              num1_packed_byte = temp_num2->packed_number_block[i];
              num1_nibble_low  = num1_packed_byte & 0x0f;
              num1_nibble_high = (num1_packed_byte & 0xf0) >> 4;
              difference_nibble_low  = num1_nibble_low + carry;
              if (difference_nibble_low >= 10)
              {
                difference_nibble_low = difference_nibble_low - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_nibble_high = num1_nibble_high + carry;
              if (difference_nibble_high >= 10)
              {
                difference_nibble_high = difference_nibble_high - 10;
                carry = 1;
              }
              else
              {
                carry = 0;
              }
              difference_packed_byte = (difference_nibble_high << 4) + difference_nibble_low;
              difference_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
              i++;
            }
            else
            {
              if (temp_num2->highest_nibble_position == lo)
              {
                num1_packed_byte = temp_num2->packed_number_block[i];
                num1_nibble_low  = num1_packed_byte & 0x0f;
                difference_nibble_low  = num1_nibble_low + carry;
                if (difference_nibble_low >= 10)
                {
                  difference_nibble_low = difference_nibble_low - 10;
                  carry = 1;
                }
                else
                {
                  carry = 0;
                }
                difference_packed_byte = difference_nibble_low;
                difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
                i++;
              }
            }
          }    
          temp_num2 = temp_num2->next_number_block;
        }
      }
    }
    if (carry == 1)
    {
      difference_packed_byte = 1;
      difference_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (difference_left_of_decimal, difference_packed_byte);
    }
// *************************************************************************************************************************
// * Edge case: check if difference (Right of Decimal) is all zeros. If that's the case, then do not append the RIGHT of DECIMAL. *
// *************************************************************************************************************************
    found_all_zeros_right_of_decimal = TRUE;
    if (difference_right_of_decimal != NULL)
    {
      temp_difference = difference_right_of_decimal->first_number_block;
      while ((temp_difference != NULL) && found_all_zeros_right_of_decimal)
      {
        if ((temp_difference->highest_digit_position >= 0) && (temp_difference->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
        {
          i = 0;
          while ((i < temp_difference->highest_digit_position) && found_all_zeros_right_of_decimal)
          {
            if (temp_difference->packed_number_block[i] > 0)
            {
              found_all_zeros_right_of_decimal = FALSE;
            }
            i++;
          }
        }
        temp_difference = temp_difference->next_number_block;
      }
      if (found_all_zeros_right_of_decimal)
      {
// *********************************************************
// * Release the memory for Right of Decimal number block. *
// *********************************************************
        temp_number_block_right_of_decimal = difference_right_of_decimal;
        while (difference_right_of_decimal != NULL)
        {
          temp_number_block_right_of_decimal = difference_right_of_decimal;
          difference_right_of_decimal = difference_right_of_decimal->next_number_block;
          free (temp_number_block_right_of_decimal);
        }
      }
    }
  } 
  if (difference == NULL)
  {
    difference = (psflt *) malloc(sizeof(psflt));
    if (difference != NULL)
    {
      difference->left_of_decimal = difference_left_of_decimal;
      difference->right_of_decimal = difference_right_of_decimal;
    }
  }
  return difference;
}















// **********************************************************************************************************
// * packed_string_float_subtract                                                                           *
// *                                                                                                        *
// * This is the main subroutine to call when subtracting two packed string-based integers.                 *
// * Upon success, a packed string-based floating-point number is returned. Upon failure, NULL is returned. *
// **********************************************************************************************************
psflt * packed_string_float_subtract (psflt *difference, psflt *num1, psflt *num2)
{
  psflt *temp_num1, *temp_num2;
  int greater_number;

 temp_num1 = NULL;
 temp_num2 = NULL;
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (difference != NULL)
  {
    difference = packed_string_float_component_release_memory (difference);
  }
  if ((num1 != NULL) && (num2 != NULL))
  {
    if (num1->sign == positive)
    {
      if (num2->sign == positive)
      {
        greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
        switch (greater_number)
        {
          case 1: // num1 is greater than num2. Difference will be positive since num1 is greater than num2.
            difference = _packed_string_float_subtract_both_numbers_same_sign (difference, num1, num2);
            difference = packed_string_float_set_sign (difference, positive);
          break;
          case 0: // num1 is equal to num2. Difference will be zero.
            difference = packed_string_float_initialize_to_zero (difference);
          break;
          case -1: // num1 is less than num2. Difference will be negative since num2 is greater than num1. 
            difference = _packed_string_float_subtract_both_numbers_same_sign (difference, num2, num1);
            difference = packed_string_float_set_sign (difference, negative);
          break;
          default:
            printf ("ERROR: stringfloat_determine_absolute_value_larger_of_two_integers returned an error.\n");
            exit (1);
          break;
        }
      }
      else
      {
// ***********************************************************************
// * Subtracting from a negative number is the same as adding the number *
// ***********************************************************************
        if (num2->sign == negative)
        {
          temp_num2 = packed_string_float_copy_number (temp_num2, num2);
          temp_num2 = packed_string_float_set_sign (temp_num2, positive);
          difference = _packed_string_float_add_both_numbers_same_sign (difference, num1, temp_num2);
          difference = packed_string_float_set_sign (difference, positive);
          temp_num2 = packed_string_float_release_memory (temp_num2);
        }
        else
        {
          if (num2->sign == zero)
          {
            difference = packed_string_float_copy_number (difference, num1);
          }
        }
      }
    }
    else
    {
      if (num1->sign == negative)
      {
        if (num2->sign == positive)
        {
// ************************************************************************************************************
// * Subtracing num2 from num1 is like adding two negative numbers together and preserving the negative sign. *
// ************************************************************************************************************
          temp_num1 = packed_string_float_copy_number (temp_num1, num1);
          temp_num1 = packed_string_float_set_sign (temp_num1, positive);
          difference = _packed_string_float_add_both_numbers_same_sign (difference, temp_num1, num2);
          difference = packed_string_float_set_sign (difference, negative);
          temp_num1 = packed_string_float_release_memory (temp_num1);
        }
        else
        {
          if (num2->sign == zero)
          {
            difference = packed_string_float_copy_number (difference, num1);
          }
          else
          {
            if (num2->sign == negative)
            {
// **********************************************************************************************************************************************
// * Subtracing num2 (with negative sign) from num1 (with negative sign) is like adding num2 (with positive sign) to num1 (with negative sign). *
// * This could be further revised as num2 (with positive sign) minus num1 (with positive sign).                                                *
// **********************************************************************************************************************************************
              temp_num1 = packed_string_float_copy_number (temp_num1, num1);
              temp_num1 = packed_string_float_set_sign (temp_num1, positive);
              temp_num2 = packed_string_float_copy_number (temp_num2, num2);
              temp_num2 = packed_string_float_set_sign (temp_num2, positive);
              greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
              switch (greater_number)
              {
                case 1: // |num1| is greater than |num2|. Difference will be negative since |num1| is greater than |num2|.
                  difference = _packed_string_float_subtract_both_numbers_same_sign (difference, temp_num1, temp_num2);
                  difference = packed_string_float_set_sign (difference, negative);
                break;
                case 0: // |num1| is equal to |num2|. Difference will be zero.
                  difference = packed_string_float_initialize_to_zero (difference);
                break;
                case -1: // |num1| is less than |num2|. Difference will be positive since |num2| is greater than |num1|. 
                  difference = _packed_string_float_subtract_both_numbers_same_sign (difference, temp_num2, temp_num1);
                  difference = packed_string_float_set_sign (difference, positive);
                break;
                default:
                  printf ("ERROR: stringfloat_determine_absolute_value_larger_of_two_integers returned an error.\n");
                  exit (1);
                break;
              }
            }
          }
        }
      }
      else
      {
        if (num1->sign == zero)
        {
          if (num2->sign == positive)
          {
            difference = packed_string_float_copy_number (difference, num2);
            difference = packed_string_float_set_sign (difference, negative);
          }
          else
          {
            if (num2->sign == negative)
            {
              difference = packed_string_float_copy_number (difference, num2);
              difference = packed_string_float_set_sign (difference, positive);
            }
            else
            {
              if (num2->sign == zero)
              {
                difference = packed_string_float_initialize_to_zero (difference);
              }
            }
          }
        }
      }
    }
  }
  return difference;
}




// ******************************************************************************************************************
// * packed_string_float_multiply                                                                                   *
// *                                                                                                                *
// * Call this subroutine to multiply two packed string-based floating-point numbers together.                      *
// *                                                                                                                *
// * Inputs: num1 (packed string-based floating-point number) and num2 (packed string-based floating point number). *
// * Output: A packed string-based floating-point number representing the product of num1 and num2.                 *
// ******************************************************************************************************************
psflt * packed_string_float_multiply (psflt *product, psflt *num1, psflt *num2)
{
  psint *num1_integer, *num2_integer, *product_integer, *adjusted_num1_integer, *adjusted_num2_integer;
  psnc *temp_num1_right_of_decimal, *temp_num2_right_of_decimal;
  int greater_number;
  long long int num1_number_of_digits_right_of_decimal, num2_number_of_digits_right_of_decimal, total_number_of_digits_right_of_decimal;
  long long int number_of_decimal_shifts, num1_number_of_decimal_shifts, num2_number_of_decimal_shifts;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (product != NULL)
  {
    product = packed_string_float_component_release_memory (product);
  }
  num1_integer = NULL;
  num2_integer = NULL;
  product_integer = NULL;
  adjusted_num1_integer = NULL;
  adjusted_num2_integer = NULL;
  num1_number_of_digits_right_of_decimal  = 0;
  num2_number_of_digits_right_of_decimal  = 0;
  total_number_of_digits_right_of_decimal = 0;
  if ((num1 != NULL) && (num2 != NULL))
  {
    if ((num1->sign == zero) || (num2->sign == zero))
    {
      product = packed_string_float_initialize_to_zero (product);
    }
    else
    {
// **************************************************************************************************************************************
// * First I convert num1 (a stringfloat) into a stringint. I preserve digit order and position (left of decimal and right of decimal). *
// **************************************************************************************************************************************
      if ((num1->left_of_decimal != NULL) || (num1->right_of_decimal != NULL))
      {
        //printf ("num1 = ");
        //packed_string_float_display (num1, 0);
        //printf ("\n");
  
        num1_integer = copy_packed_string_float_digits_into_packed_string_integer (num1_integer, num1);
  
        //printf ("num1_integer = ");
        //packed_string_integer_display (num1_integer, 0);
        //printf ("\n");
  
        num1_number_of_digits_right_of_decimal = 0;
        if (num1->right_of_decimal != NULL)
        {
// ****************************************************************************
// * Now count the number of significant digits right of the decimal for num1 *
// ****************************************************************************
          temp_num1_right_of_decimal = num1->right_of_decimal->first_number_block;
          while (temp_num1_right_of_decimal != NULL)
          {
            if ((temp_num1_right_of_decimal->highest_digit_position >= 0) && (temp_num1_right_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              if (temp_num1_right_of_decimal->highest_nibble_position == hi)
              { 
                num1_number_of_digits_right_of_decimal = num1_number_of_digits_right_of_decimal + 2;
              }
              else
              {
                if (temp_num1_right_of_decimal->highest_nibble_position == lo)
                { 
                  num1_number_of_digits_right_of_decimal = num1_number_of_digits_right_of_decimal + 1;
                }
              }
              num1_number_of_digits_right_of_decimal = num1_number_of_digits_right_of_decimal + temp_num1_right_of_decimal->highest_digit_position * 2;
            }   
            else
            {
              printf ("Error in packed_string_integer_multiply() num1->number_of_digits is greater than MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_num1_right_of_decimal = temp_num1_right_of_decimal->next_number_block;
          }
        }
      }
      //printf ("num1_number_of_digits_right_of_decimal = %lld\n", num1_number_of_digits_right_of_decimal);
// **************************************************************************************************************************************
// * Next, I convert num2 (a stringfloat) into a stringint. I preserve digit order and position (left of decimal and right of decimal). *
// **************************************************************************************************************************************
      if ((num2->left_of_decimal != NULL) || (num2->right_of_decimal != NULL))
      {
        //printf ("num2 = ");
        //packed_string_float_display (num2, 0);
        //printf ("\n");
        num2_integer = copy_packed_string_float_digits_into_packed_string_integer (num2_integer, num2);
        if (num2_integer != NULL)
        {
          //printf ("num2_integer = ");
          //packed_string_integer_display (num2_integer, 0);
          //printf ("\n");
        }
        num2_number_of_digits_right_of_decimal = 0;
        if (num2->right_of_decimal != NULL)
        {
// ****************************************************************************
// * Now count the number of significant digits right of the decimal for num2 *
// ****************************************************************************
          temp_num2_right_of_decimal = num2->right_of_decimal->first_number_block;
          while (temp_num2_right_of_decimal != NULL)
          {
            if ((temp_num2_right_of_decimal->highest_digit_position >= 0) && (temp_num2_right_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              if (temp_num2_right_of_decimal->highest_nibble_position == hi)
              { 
                num2_number_of_digits_right_of_decimal = num2_number_of_digits_right_of_decimal + 2;
              }
              else
              {
                if (temp_num2_right_of_decimal->highest_nibble_position == lo)
                { 
                  num2_number_of_digits_right_of_decimal = num2_number_of_digits_right_of_decimal + 1;
                }
              }
              num2_number_of_digits_right_of_decimal = num2_number_of_digits_right_of_decimal + temp_num2_right_of_decimal->highest_digit_position * 2;
            }   
            else
            {
              printf ("Error in packed_string_integer_multiply() num2->number_of_digits is greater than MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_num2_right_of_decimal = temp_num2_right_of_decimal->next_number_block;
          }
        }
      }
      //printf ("num2_number_of_digits_right_of_decimal = %lld\n", num2_number_of_digits_right_of_decimal);
      number_of_decimal_shifts = 0;
      if (llabs(num1_number_of_digits_right_of_decimal) > llabs(num2_number_of_digits_right_of_decimal))
      {
        //printf ("NUM1_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL > NUM2_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL\n");
        number_of_decimal_shifts = llabs(num1_number_of_digits_right_of_decimal);
        num2_number_of_decimal_shifts = number_of_decimal_shifts - llabs(num2_number_of_digits_right_of_decimal);
        //printf ("number_of_decimal_shifts = %lld\n", number_of_decimal_shifts);
        adjusted_num1_integer = packed_string_integer_copy_number (adjusted_num1_integer, num1_integer);
        adjusted_num2_integer = packed_string_integer_shift_digits_left (num2_integer, num2_number_of_decimal_shifts);
        total_number_of_digits_right_of_decimal = num1_number_of_digits_right_of_decimal * 2;
      }
      else
      {
        if (llabs(num2_number_of_digits_right_of_decimal) > llabs(num1_number_of_digits_right_of_decimal))
        { 
          //printf ("NUM2_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL > NUM1_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL\n");
          number_of_decimal_shifts = llabs(num2_number_of_digits_right_of_decimal);
          num1_number_of_decimal_shifts = number_of_decimal_shifts - llabs(num1_number_of_digits_right_of_decimal);
          //printf ("number_of_decimal_shifts = %lld\n", number_of_decimal_shifts);
          adjusted_num1_integer = packed_string_integer_shift_digits_left (num1_integer, num1_number_of_decimal_shifts);     
          adjusted_num2_integer = packed_string_integer_copy_number (adjusted_num2_integer, num2_integer);
          total_number_of_digits_right_of_decimal = num2_number_of_digits_right_of_decimal * 2;
        }
        else
        {
          //printf ("NUM1_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL == NUM2_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL\n");
          adjusted_num1_integer = packed_string_integer_copy_number (adjusted_num1_integer, num1_integer);
          adjusted_num2_integer = packed_string_integer_copy_number (adjusted_num2_integer, num2_integer);
          total_number_of_digits_right_of_decimal = num1_number_of_digits_right_of_decimal * 2;
          //printf ("num2_integer structure:\n");
          //display_packed_string_integer_structure (num2_integer);
          //printf ("\n");
          //printf ("num2_integer = ");
          //packed_string_integer_display (num2_integer, 0);
          //printf ("\n");
        }
      }
      //printf ("num1 = ");
      //packed_string_float_display (num1, 1);
      //printf ("\n");
      //printf ("num2 = ");
      //packed_string_float_display (num2, 1);
      //printf ("\n");
      //printf ("num1_integer = ");
      //packed_string_integer_display (num1_integer, 1);
      //printf ("\n");
      //printf ("num2_integer = ");
      //packed_string_integer_display (num2_integer, 1);
      //printf ("\n");
      //printf ("adjusted_num1_integer = ");
      //packed_string_integer_display (adjusted_num1_integer, 1);
      //printf ("\n");
      //printf ("adjusted_num2_integer = ");
      //packed_string_integer_display (adjusted_num2_integer, 1);
      //printf ("\n");
      //printf ("num1_number_of_digits_right_of_decimal = %lld\n", num1_number_of_digits_right_of_decimal);
      //printf ("num2_number_of_digits_right_of_decimal = %lld\n", num2_number_of_digits_right_of_decimal);
      //printf ("number_of_decimal_shifts               = %lld\n", number_of_decimal_shifts);
      num1_integer = packed_string_integer_release_memory (num1_integer);
      num2_integer = packed_string_integer_release_memory (num2_integer);
      num1_integer = packed_string_integer_copy_number (num1_integer, adjusted_num1_integer);
      num2_integer = packed_string_integer_copy_number (num2_integer, adjusted_num2_integer);
      adjusted_num1_integer = packed_string_integer_release_memory (adjusted_num1_integer);
      adjusted_num2_integer = packed_string_integer_release_memory (adjusted_num2_integer);
// ************************************************************************************************************************************************
// * I perform the product on the two converted stringints (num1_integer and num2_integer). Then the final step is converting the integer product *
// * back to floating point number with a decimal point at the appropriate position.                                                              *
// ************************************************************************************************************************************************
      if ((num1_integer != NULL) && (num2_integer != NULL))
      {
        greater_number = packed_string_integer_determine_absolute_value_larger_of_two_integers (num1_integer, num2_integer);
        switch (greater_number)
        {
          case 1: // num1 > num2
            switch (num1_integer->sign)
            {
              case positive:
                switch (num2_integer->sign)
                {
                  case positive: // num1 is positive, num2 is positive, num1 * num2 = positive sign. num1 > num2
                    product_integer = packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case zero: // Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative:
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case zero: // Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                product_integer = packed_string_integer_initialize_to_zero (product_integer);
              break;
              case negative:
                switch (num2_integer->sign)
                {
                  case positive: // num1 is negative, num2 is positive. num1 * num2 = negative sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case zero: // Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative: // num1 is negative, num2 is negative. num1 * num2 = positive sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case 0: // num1 == num2
            switch (num1_integer->sign)
            {
              case positive:
                switch (num2_integer->sign)
                {
                  case positive: // num1 == num2: num1 is positive, num2 is positive, num1 * num2 = positive sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case zero: // Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative:
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case zero: // num1 == num2: Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                product_integer = packed_string_integer_initialize_to_zero (product_integer);
              break;
              case negative:
                switch (num2_integer->sign)
                {
                  case positive: // num1 == num2: num1 is negative, num2 is positive. num1 * num2 = negative sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case zero: // num1 == num2: Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative: // num1 == num2: num1 is negative, num2 is negative. num1 * num2 = positive sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case -1: // num1 < num2
            switch (num1_integer->sign)
            {
              case positive:
                switch (num2_integer->sign)
                {
                  case positive: // num1 < num2: num1 is positive, num2 is positive, num1 * num2 = positive sign
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case zero: // num1 < num2: Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative:
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case zero: // num1 < num2: Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                product_integer = packed_string_integer_initialize_to_zero (product_integer);
              break;
              case negative:
                switch (num2_integer->sign)
                {
                  case positive: // num1 < num2: num1 is negative, num2 is positive. num1 * num2 = negative sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, negative);
                  break;
                  case zero: // num1 < num2: Anything multiplied by zero is zero. Rather than compute a value, simply create a zero result.
                    product_integer = packed_string_integer_initialize_to_zero (product_integer);
                  break;
                  case negative: // num1 < num2: num1 is negative, num2 is negative. num1 * num2 = positive sign.
                    product_integer = _packed_string_integer_multiply (product_integer, num1_integer, num2_integer);
                    product_integer = packed_string_integer_set_sign (product_integer, positive);
                  break;
                  case undefined:
                  break;
                  default:
                  break;
                }
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          default:
          break;
        }
      }
// ******************************************************************
// * Now convert the product (a stringint) back into a stringfloat. *
// ******************************************************************
      if (product_integer != NULL)
      {
        if ((product_integer->sign == positive) || (product_integer->sign == negative))
        {
          //printf ("total_number_of_digits_right_of_decimal = %lld\n", total_number_of_digits_right_of_decimal);
          //printf ("product_integer = ");
          //packed_string_integer_display (product_integer, 0);
          //printf ("\n");
          //printf ("----------------------------------------------------------------\n");
          //printf ("product_integer:\n\n");
          //display_packed_string_integer_structure (product_integer);
          //printf ("\n");
          //printf ("----------------------------------------------------------------\n");
          product = copy_packed_string_integer_digits_into_packed_string_float_v2 (product, product_integer, total_number_of_digits_right_of_decimal);
        }
        else
        {
          product = packed_string_float_initialize_to_zero (product);
        }
      }
    } 
  }
// **********************************************************************************************************
// * Release memory for temporary working variables that were allocated memory but not previously released. *
// **********************************************************************************************************
  if (num1_integer != NULL)
  {
    num1_integer = packed_string_integer_release_memory (num1_integer);
  }
  if (num2_integer != NULL)
  {
    num2_integer = packed_string_integer_release_memory (num2_integer);
  }
  if (product_integer != NULL)
  {
    product_integer = packed_string_integer_release_memory (product_integer);
  }
  return product;
}




// ********************************************************************************************************************************************************************
// * copy_packed_string_integer_digits_into packed_string_float_v2                                                                                                    *
// *                                                                                                                                                                  *
// * This is an unusual subroutine in that it copies all digits linearly from least sigificant digit RIGHT of decimal to most significant digit LEFT of decimal. This *
// * subroutine is NOT a general-purpose string integer to string float conversion program. Instead, this function is used internally for string-based floating point *
// * multiplication and division.                                                                                                                                     *
// ********************************************************************************************************************************************************************
psflt * copy_packed_string_integer_digits_into_packed_string_float_v2 (psflt *converted_result, psint *input_number, long long int total_number_of_digits_right_of_decimal)
{
  psnc *temp_input_number, *converted_result_left_of_decimal, *converted_result_right_of_decimal;
  unsigned char byte, packed_byte, nibble_low, nibble_high, done;
  long long int i, digit_counter;
  enum occupied_nibble;
  digit_stack_node *digit_stack, *temp_digit_stack, *digit_stack_right_of_decimal;

  converted_result_left_of_decimal  = NULL;
  converted_result_right_of_decimal = NULL;
  temp_digit_stack = NULL;
  digit_stack_right_of_decimal = NULL;
  if (converted_result != NULL)
  {
    converted_result = packed_string_float_component_release_memory (converted_result);
  }
  if (input_number != NULL)
  {
    if (input_number->left_of_decimal != NULL)
    {
      if ((input_number->sign == positive) || (input_number->sign == negative))
      {
        if (total_number_of_digits_right_of_decimal == 0)
        {
// *****************************************************************************************************
// * There are no digits RIGHT of the decimal, therefore copy all stringint digits to LEFT of decimal. *
// *****************************************************************************************************
          temp_input_number = input_number->left_of_decimal;
          while (temp_input_number != NULL)
          {
            if ((temp_input_number->highest_digit_position >= 0) && (temp_input_number->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < temp_input_number->highest_digit_position; i++)
              { 
                packed_byte = temp_input_number->packed_number_block[i];
                converted_result_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (converted_result_left_of_decimal, packed_byte);
              }
              packed_byte = temp_input_number->packed_number_block[i];
              if (temp_input_number->highest_nibble_position == hi)
              {
                converted_result_left_of_decimal = packed_string_float_append_two_digits_left_of_decimal (converted_result_left_of_decimal, packed_byte);
              }
              else
              {
                if (temp_input_number->highest_nibble_position == lo)
                {
                  nibble_low  = packed_byte & 0x0f;
                  converted_result_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_result_left_of_decimal, nibble_low);
                }
              }
            }
            else
            {
              printf ("Internal error occurred in copy_packed_string_integer_digits_into_packed_string_float(). temp_input_number->highest_digit_position contains is either negative or exceeds MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_input_number = temp_input_number->next_number_block;
          }
        }
        else
        {
// ************************************************************************************************************************************************* 
// * First we must advance to TOTAL_NUMBER_OF_DIGITS_RIGHT_OF_DECIMAL byte-by-byte from the least significant digit in the string integer to the   *
// * most significant digit of the string integer. However, we must only advance enough bytes to the place where the decimal point should be. Then *
// * we will copy all digits from that point to the least significant digit in the string integer.                                                 *
// ************************************************************************************************************************************************* 
          digit_stack = NULL;
          temp_input_number = input_number->left_of_decimal;
          while (temp_input_number != NULL)
          {
            if ((temp_input_number->highest_digit_position >= 0) && (temp_input_number->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE))
            {
              for (i = 0; i < temp_input_number->highest_digit_position; i++)
              { 
                packed_byte = temp_input_number->packed_number_block[i];
                nibble_low  = (packed_byte & 0x0f) + '0';
                nibble_high = ((packed_byte & 0xf0) >> 4) + '0';
                digit_stack = push_digit_stack (digit_stack, nibble_low);
                digit_stack = push_digit_stack (digit_stack, nibble_high);
              }
              packed_byte = temp_input_number->packed_number_block[i];
              if (temp_input_number->highest_nibble_position == hi)
              {
                nibble_low  = (packed_byte & 0x0f) + '0';
                nibble_high = ((packed_byte & 0xf0) >> 4) + '0';
                digit_stack = push_digit_stack (digit_stack, nibble_low);
                digit_stack = push_digit_stack (digit_stack, nibble_high);
              }
              else
              {
                if (temp_input_number->highest_nibble_position == lo)
                {
                  nibble_low = (packed_byte & 0x0f) + '0';
                  digit_stack = push_digit_stack (digit_stack, nibble_low);
                }
              }
            }
            else
            {
              printf ("Internal error occurred in copy_packed_string_integer_digits_into_packed_string_float(). temp_input_number->highest_digit_position contains is either negative or exceeds MAX_PACKED_NUMBER_BLOCK_SIZE. Exiting now.\n");
              exit (EXIT_FAILURE);
            }
            temp_input_number = temp_input_number->next_number_block;
          }
// *******************************************************************************************************************************
// * Reverse the order of digits on the stack. This places the least significant digit RIGHT of DECIMAL at the top of the stack. *
// *******************************************************************************************************************************
          temp_digit_stack = NULL;
          while (digit_stack != NULL)
          {
            byte = top_digit_stack (digit_stack);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack = pop_digit_stack (digit_stack);
          }
// ***********************************************************************************
// * Now partition the stack into a LEFT of DECIMAL and RIGHT of DECIMAL components. *
// ***********************************************************************************
          digit_stack_right_of_decimal = NULL;
          digit_counter = 0;
          while ((temp_digit_stack != NULL) && (digit_counter < total_number_of_digits_right_of_decimal))
          {
            byte = top_digit_stack (temp_digit_stack);
            digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, byte);
            digit_counter++;
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
          while (digit_counter < total_number_of_digits_right_of_decimal)
          {
            digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, '0');
            digit_counter++;
          }
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            byte = byte - '0';
            converted_result_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_result_left_of_decimal, byte);
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
// ******************************************************************
// * Reverse the order of the digits on the RIGHT_OF_DECIMAL_STACK. * 
// * This places the least significant digit RIGHT of DECIMAL at    *
// * the top of the stack.                                          *
// ******************************************************************
          while (digit_stack_right_of_decimal != NULL)
          {
            byte = top_digit_stack (digit_stack_right_of_decimal);
            temp_digit_stack = push_digit_stack (temp_digit_stack, byte);
            digit_stack_right_of_decimal = pop_digit_stack (digit_stack_right_of_decimal);
          }
// ***********************************************************************
// * If the least significant digit RIGHT of DECIMAL is zero, remove it. *
// ***********************************************************************
          done = FALSE;
          while ((temp_digit_stack != NULL) && (!done))
          {
            byte = top_digit_stack (temp_digit_stack);
// *************************************************************************
// * If the least significant digit RIGHT of DECIMAL is a zero, remove it. *
// *************************************************************************
            if (byte > '0')
            {
              done = TRUE;
            }
            else
            {
              temp_digit_stack = pop_digit_stack (temp_digit_stack);
            }
          }
          while (temp_digit_stack != NULL)
          {
            byte = top_digit_stack (temp_digit_stack);
            digit_stack_right_of_decimal = push_digit_stack (digit_stack_right_of_decimal, byte);
            temp_digit_stack = pop_digit_stack (temp_digit_stack);
          }
// ******************************************************************************************************************************
// * Now append the RIGHT of DECIMAL digit stack digits into the string-based RIGHT of DECIMAL floating point number component. *
// ******************************************************************************************************************************
          while (digit_stack_right_of_decimal != NULL)
          {
            byte = top_digit_stack (digit_stack_right_of_decimal);
            byte = byte - '0';
            converted_result_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_result_right_of_decimal, byte);
            digit_stack_right_of_decimal = pop_digit_stack (digit_stack_right_of_decimal);
          }
        }
        if ((converted_result_left_of_decimal != NULL) || (converted_result_right_of_decimal != NULL))
        {
          converted_result = (psflt *) malloc(sizeof(psflt));
          if (converted_result != NULL)
          {
            converted_result->sign = input_number->sign;
            converted_result->left_of_decimal  = converted_result_left_of_decimal;
            converted_result->right_of_decimal = converted_result_right_of_decimal;
            converted_result->status_flag = 0;
          }
        }
      } 
      else
      {
// *********************************************************************************************************
// * The input number is zero, therefore, create a packed string-based floating-point number that is zero. *
// *********************************************************************************************************
        converted_result = packed_string_float_initialize_to_zero (converted_result);
      }
    }
  }
  return converted_result;
}




// *****************************************************************************************************************
// * packed_string_float_divide                                                                                    *
// *                                                                                                               *
// * Call this subroutine to divide two string-based floats together.                                              *
// *                                                                                                               *
// * Inputs: num1 (packed string-based floating-point number)                                                      *
// *         num2 (packed string-based floating-point number)                                                      *
// *         num_digits_of_precision_right_of_decimal                                                              *
// *                                                                                                               *
// * num_digits_of_precious_right_of_decimal limits the number of digits computed and stored to the right of the   *
// * decimal when the resulting division creates a repeating, non-terminating decimal.                             *                     
// *                                                                                                               *
// * Output: A packed string-based floating-point number representing the qoutient and remainder of num1 and num2. *  
// *****************************************************************************************************************
psflt * packed_string_float_divide (psflt *quotient_and_remainder, psflt *numerator, psflt *denominator, long long int num_digits_of_precision_right_of_decimal)
{
  int numerator_contains_digits, denominator_contains_digits;

  numerator_contains_digits   = FALSE;
  denominator_contains_digits = FALSE;
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (quotient_and_remainder != NULL)
  {
    quotient_and_remainder = packed_string_float_component_release_memory (quotient_and_remainder);
  }
  if (numerator != NULL)
  {
    if ((numerator->left_of_decimal != NULL) || (numerator->right_of_decimal != NULL))
    {
      numerator_contains_digits = TRUE;
    }
    else
    {
      if (numerator->sign == zero)
      {
        numerator_contains_digits = TRUE;
      }
    }
  }
  if (denominator != NULL)
  {
    if ((denominator->left_of_decimal != NULL) || (denominator->right_of_decimal != NULL))
    {
      denominator_contains_digits = TRUE;
    }
    else
    {
      if (denominator->sign == zero)
      {
        denominator_contains_digits = TRUE;
      }
    }
  }
  if (!numerator_contains_digits)
  {
    quotient_and_remainder = (psflt *) malloc(sizeof(psflt));
    if (quotient_and_remainder != NULL)
    {
      quotient_and_remainder->left_of_decimal  = NULL;
      quotient_and_remainder->right_of_decimal = NULL;
      quotient_and_remainder->sign             = undefined;
      quotient_and_remainder->status_flag = INTERNAL_ERROR;
    }
  }
  if (!denominator_contains_digits)
  {
    quotient_and_remainder = (psflt *) malloc(sizeof(psflt));
    if (quotient_and_remainder != NULL)
    {
      quotient_and_remainder->left_of_decimal  = NULL;
      quotient_and_remainder->right_of_decimal = NULL;
      quotient_and_remainder->sign             = undefined;
      quotient_and_remainder->status_flag      = INTERNAL_ERROR;
    }
  }
  if (numerator_contains_digits && denominator_contains_digits)
  {
    if (denominator->sign == zero)
    {
      quotient_and_remainder = (psflt *) malloc(sizeof(psflt));
      if (quotient_and_remainder != NULL)
      {
        quotient_and_remainder->left_of_decimal  = NULL;
        quotient_and_remainder->right_of_decimal = NULL;
        quotient_and_remainder->sign             = undefined;
        quotient_and_remainder->status_flag      = DIVIDE_BY_ZERO;
      }
    }
    else
    {
      if (numerator->sign == zero)
      {
        quotient_and_remainder = packed_string_float_initialize_to_zero (quotient_and_remainder);
      }
      else
      {
        quotient_and_remainder = _packed_string_float_divide (quotient_and_remainder, numerator, denominator, num_digits_of_precision_right_of_decimal);
        if (quotient_and_remainder != NULL)
        {
          switch (numerator->sign)
          {
            case positive:
              switch (denominator->sign)
              {
                case positive:
                  quotient_and_remainder->sign = positive;
                break;
                case negative:
                  quotient_and_remainder->sign = negative;
                break;
                default:
                break;
              }
            break;
            case negative:
              switch (denominator->sign)
              {
                case positive:
                  quotient_and_remainder->sign = negative;
                break;
                case negative:
                  quotient_and_remainder->sign = positive;
                break;
                default:
                break;
              }
            break;
            default:
            break;
          }
        }
      }
    }
  }
  return quotient_and_remainder;
}




// **************************************************************************************************************************************************
// * packed_string_float_equal                                                                                                                      *
// *                                                                                                                                                *
// * This library determiness if a packed string-based floating-point number (num1) is equal to a packed string-based floating-point number (num2). *
// *                                                                                                                                                *
// * If num1 == num2 return 1 (TRUE)                                                                                                                *
// * If num1 != num2 return 0 (FALSE)                                                                                                               *
// *                                                                                                                                                *
// * If an error occurs, 0 (FALSE) is returned.                                                                                                     *
// **************************************************************************************************************************************************
unsigned char packed_string_float_equal (psflt *num1, psflt *num2)
{
  unsigned char num1_equals_num2;
  int greater_number;

  num1_equals_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, return FALSE.
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2 
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_equals_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, return TRUE.
                num1_equals_num2 = 1;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_equals_num2 = 0;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_equals_num2 = 1;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, return FALSE.
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_equals_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_equals_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_equals_num2 = 0;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 > num2
                num1_equals_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -2: // error occurred
      break;
      default:
      break;
    }
  }
  return num1_equals_num2;
}




// **************************************************************************************************************
// * packed_string_float_not_equal                                                                              *
// *                                                                                                            *
// * This library determiness if packed string-based float num1 is not equal to packed string-based float num2. *
// *                                                                                                            *
// * If num1 != num2 return 1 (TRUE)                                                                            *
// * If num1 == num2 return 0 (FALSE)                                                                           *
// *                                                                                                            *
// * If an error occurs, 0 (FALSE) is returned.                                                                 *
// **************************************************************************************************************
unsigned char packed_string_float_not_equal (psflt *num1, psflt *num2)
{
  unsigned char num1_is_not_equal_num2;
  int greater_number;

  num1_is_not_equal_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_is_not_equal_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, return FALSE.
                num1_is_not_equal_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_is_not_equal_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_is_not_equal_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2 
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_is_not_equal_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, return FALSE.
                num1_is_not_equal_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_is_not_equal_num2 = 0;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, return FALSE.
                num1_is_not_equal_num2 = 0;
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_is_not_equal_num2 = 0;
              break;
              default:
              break;
            }
          break;
          default:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_is_not_equal_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_not_equal_num2 = 1;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 > num2
                num1_is_not_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          default:
          break;
        }
      break;
      default:
      break;
    }
  }
  return num1_is_not_equal_num2;
}




// ***************************************************************************************************************************************************
// * packed_string_float_less_than                                                                                                                   *
// *                                                                                                                                                 *
// * This library determiness if a packed string-based floating-point number (num1) is less than a packed string-based floating-point number (num2). *
// *                                                                                                                                                 *
// * If num1 <  num2 return 1 (TRUE)                                                                                                                 *
// * If num1 >= num2 return 0 (FALSE)                                                                                                                *
// *                                                                                                                                                 *
// * If an error occurs, 0 (FALSE) is returned.                                                                                                      *
// ***************************************************************************************************************************************************
unsigned char packed_string_float_less_than (psflt *num1, psflt *num2)
{
  unsigned char num1_is_less_than_num2;
  int greater_number;

  num1_is_less_than_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_is_less_than_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_is_less_than_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, return FALSE
                num1_is_less_than_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE
                num1_is_less_than_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_is_less_than_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_is_less_than_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2 
                num1_is_less_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_is_less_than_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, return FALSE
                num1_is_less_than_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, num1 == num2
                num1_is_less_than_num2 = 0;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_is_less_than_num2 = 0;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, return FALSE
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE
                num1_is_less_than_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_less_than_num2 = 1;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 > num2
                num1_is_less_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -2:
        printf ("An internal error occurred: packed_string_float_determine_absolute_value_larger_of_two_floats returned -2. Exiting now.\n"); 
        exit (EXIT_FAILURE);
      break;
      default:
      break;
    }
  }
  return num1_is_less_than_num2;
}




// ***************************************************************************************************************************
// * packed_string_float_less_than_or_equal                                                                                  *
// *                                                                                                                         *
// * This library determiness if a packed string-based float num1 is less than or equal to a packed string-based float num2. *
// *                                                                                                                         *
// * If num1 <= num2 return 1 (TRUE)                                                                                         *
// * If num1 > num2 return 0 (FALSE)                                                                                         *
// *                                                                                                                         *
// * If an error occurs, 0 (FALSE) is returned.                                                                              *
// ***************************************************************************************************************************
unsigned char packed_string_float_less_than_or_equal (psflt *num1, psflt *num2)
{
  unsigned char num1_is_less_than_or_equal_num2;
  int greater_number;

  num1_is_less_than_or_equal_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, return FALSE.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2.
                num1_is_less_than_or_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, return FALSE.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, return FALSE.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, return FALSE.
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| < |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_less_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 < num2
                num1_is_less_than_or_equal_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case undefined:
      break;
      default:
      break;
    }
  }
  return num1_is_less_than_or_equal_num2;
}




// **************************************************************************************************************
// * packed_string_float_greater_than                                                                           *
// *                                                                                                            *
// * This library determiness if packed string-based float num1 is greater than packed string-based float num2. *
// *                                                                                                            *
// * If num1 >  num2 return 1 (TRUE)                                                                            *
// * If num1 <= num2 return 0 (FALSE)                                                                           *
// *                                                                                                            *
// * If an error occurs, 0 (FALSE) is returned.                                                                 *
// **************************************************************************************************************
unsigned char packed_string_float_greater_than (psflt *num1, psflt *num2)
{
  unsigned char num1_is_greater_than_num2;
  int greater_number;

  num1_is_greater_than_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_is_greater_than_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_is_greater_than_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, set result to num1 < num2.
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, set result to num1 < num2.
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2 
                num1_is_greater_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, set result to num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, num1 == num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, set result to num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_is_greater_than_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, set result to num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_greater_than_num2 = 0;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 > num2
                num1_is_greater_than_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      default:
      break;
    }
  }
  return num1_is_greater_than_num2;
}




// **********************************************************
// * packed_string_float_greater_than_or_equal              *
// *                                                        *
// * This library determines if num1 is greater than num2.  *
// *                                                        *
// * If num1 >= num2 return 1 (TRUE)                        *
// * If num1 <= num2 return 0 (FALSE)                       *
// *                                                        *
// * If an error occurs, 0 (FALSE) is returned.             *
// **********************************************************
unsigned char packed_string_float_greater_than_or_equal (psflt *num1, psflt *num2)
{
  unsigned char num1_is_greater_than_or_equal_num2;
  int greater_number;

  num1_is_greater_than_or_equal_num2 = 0; // initialize to FALSE
  if ((num1 != NULL) && (num2 != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, num2);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is positive and num2 is positive, num1 > num2.
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| > |num2|. Since num1 is positive and num2 is zero, num1 > num2.
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| > |num2|. Since num1 is positive and num2 is negative, num1 > num2.
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. I do not know how num1 can be greater than num2 and yet num1 is zero while num2 is positive. Regardless, set result to num1 < num2.
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, set result to num1 < num2.
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is zero and num2 is negative, num1 > num2.
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| > |num2|. Since num1 is negative and num2 is positive, num1 < num2.
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| > |num2|. Since num1 is negative and num2 is zero, num1 < num2.
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| > |num2|. Since num1 is negative and num2 is negative, num1 < num2 
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case 0: // |num1| == |num2|
        switch (num1->sign)
        {
          case positive:
            switch (num2->sign)
            {
              case positive:  // |num1| == |num2|. Since num1 is positive and num2 is positive, num1 == num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case zero:     // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is positive and num2 is zero. Regardless, set result to num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is positive and num2 is negative, num1 > num2 
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is zero and num2 is positive, set result to num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:    // |num1| == |num2|. Since num1 is zero and num2 is zero, num1 == num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case negative: // |num1| == |num2|. I do not know how num1 and num2 can be equal since num1 is zero and num2 is negative. Regardless, set result to num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative:
            switch (num2->sign)
            {
              case positive: // |num1| == |num2|. Since num1 is negative and num2 is positive,  num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| == |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| == |num2|. Since num1 is negative and num2 is negative, num1 == num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case -1: // num1 < num2
        switch (num1->sign)
        {
          case positive: // num1 is positive
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is positive and num2 is positive, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. Since num1 is positive and num2 is zero, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is positive and num2 is negative, num1 > num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case zero: // num1 is zero
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is zero and num2 is positive, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. I do not know how num1 can be greater than num2 yet num1 equals zero and num2 equals zero. Regardless, set result to num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| < |num2|. Since num1 is zero and num2 is negative, num1 > num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case negative: // num1 is negative
            switch (num2->sign)
            {
              case positive: // |num1| < |num2|. Since num1 is negative and num2 is positive, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case zero:     // |num1| < |num2|. Since num1 is negative and num2 is zero, num1 < num2
                num1_is_greater_than_or_equal_num2 = 0;
              break;
              case negative: // |num1| < |num2|.  Since num1 and num2 are both negative, num1 > num2
                num1_is_greater_than_or_equal_num2 = 1;
              break;
              case undefined:
              break;
              default:
              break;
            }
          break;
          case undefined:
          break;
          default:
          break;
        }
      break;
      case undefined:
      break;
      default:
      break;
    }
  }
  return num1_is_greater_than_or_equal_num2;
}




// **********************************************************************************
// * packed_string_float_power                                                      *
// *                                                                                *
// * This function returns base ^ exponent (or base raised to the exponent) result. *
// **********************************************************************************
psflt * packed_string_float_power (psflt *result, psflt *base, unsigned long long int exponent)
{
  unsigned long long int i;
  psflt *product;

  product = NULL;
// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (result != NULL)
  {
    result = packed_string_float_component_release_memory (result);
  }
  if (base != NULL)
  {
    if ((base->left_of_decimal != NULL) || (base->right_of_decimal != NULL))
    {
      if (exponent == 0)
      {
        result = packed_string_float_set_value (result, "1.0");
      }
      else
      {
        result = packed_string_float_copy_number (result, base);  
        if (result != NULL)
        {
          for (i = 1; i < exponent; i++)
          {
            product = packed_string_float_multiply (product, result, base);
            result = packed_string_float_component_release_memory (result);
            result = packed_string_float_copy_number (result, product);
            product = packed_string_float_component_release_memory (product);
          }
        }
      }
    }
    else
    {
      if (base->sign == zero)
      {
        result = packed_string_float_initialize_to_zero (result);
      }
    }
  }
  if (product != NULL)
  {
    product = packed_string_float_component_release_memory (product);
  }
  return result;
}




// ********************************************************************************************************************
// * packed_string_float_nth_root_with_bisection_method                                                               *
// *                                                                                                                  *
// * This function determines the nth root of an input string-based floating-point number using the bisection method. *
// ********************************************************************************************************************
psflt * packed_string_float_nth_root_with_bisection_method (psflt *result, psflt *input_number, unsigned long long int n)
{
  psflt *min, *max, *middle, *power;
  psflt *constant_0, *constant_2, *numerator;
  unsigned long long int num_digits_of_precision_right_of_decimal;
  unsigned char difference_less_than;
  int num_iterations;
  const int MAX_ITERATIONS = 100;

  if (result != NULL)
  {
    result = packed_string_float_component_release_memory (result);
  }
  min    = NULL;
  middle = NULL;
  max    = NULL;
  power  = NULL;
  constant_0 = NULL;
  constant_2 = NULL;
  numerator  = NULL;
  num_digits_of_precision_right_of_decimal = 1000;
  constant_0 = packed_string_float_set_value (constant_0, "0");
  constant_2 = packed_string_float_set_value (constant_2, "2");
  if ((input_number != NULL) && (constant_0 != NULL) && (constant_2 != NULL))
  {
    max = packed_string_float_copy_number (max, input_number);
    min = packed_string_float_copy_number (min, input_number);
    min = packed_string_float_set_sign (min, negative);
    numerator = packed_string_float_add (numerator, min, max);
    //printf ("min = ");
    //packed_string_float_display (min, 0);
    //printf ("\n");
    //printf ("max = ");
    //packed_string_float_display (max, 0);
    //printf ("\n");
    middle = packed_string_float_divide (middle, numerator, constant_2, num_digits_of_precision_right_of_decimal);
    //printf ("middle = ");
    //packed_string_float_display (middle, 0);
    //printf ("\n");
    power = packed_string_float_power (power, middle, n);
    num_iterations = 0;
    while (num_iterations < MAX_ITERATIONS) 
    {
      num_iterations++;
      //printf ("iteration: %d of %d\n", num_iterations, MAX_ITERATIONS);
      difference_less_than = packed_string_float_less_than (power, input_number);
      switch (difference_less_than)
      {
        case 0:
          max = packed_string_float_component_release_memory (max);
          max = packed_string_float_copy_number (max, middle);
        break;
        case 1:
          min = packed_string_float_component_release_memory (min);
          min = packed_string_float_copy_number (min, middle);
        break;
        default:
        break;
      }
      power     = packed_string_float_component_release_memory (power);
      numerator = packed_string_float_component_release_memory (numerator);
      middle    = packed_string_float_component_release_memory (middle);
      numerator = packed_string_float_add (numerator, min, max);
      middle    = packed_string_float_divide (middle, numerator, constant_2, num_digits_of_precision_right_of_decimal);
      power     = packed_string_float_power (power, middle, n);

      //printf ("min = ");
      //packed_string_float_display (min, 0);
      //printf (", middle = ");
      //packed_string_float_display (middle, 0);
      //printf (", max = ");
      //packed_string_float_display (max, 0);
      //printf (", power = ");
      //packed_string_float_display (power, 0);
      //printf ("\n");

    }
  }
  if (constant_0 != NULL)
  {
    constant_0 = packed_string_float_release_memory (constant_0);
  }
  if (constant_2 != NULL)
  {
    constant_2 = packed_string_float_release_memory (constant_2);
  }
  return middle;
}




// ***************************************************************************************************************
// * _packed_string_float_determine_seed_value_for_newton_raphson_nth_root                                       *
// *                                                                                                             *
// * This is an internal use only function to find a suitable seed (starting value approximation) for            *
// * the nth root of a number using the Newton-Raphson method. This function uses bisection method for finding a *
// * quick approximate seed value.                                                                               *
// ***************************************************************************************************************
psflt * _packed_string_float_determine_seed_value_for_newton_raphson_nth_root (psflt *result, psflt *input_number, unsigned long long int n)

{
  psflt *min, *max, *middle, *power;
  psflt *constant_0, *constant_2, *numerator;
  unsigned char difference_less_than;
  int num_iterations;
  const int MAX_ITERATIONS = 200;
  const unsigned long long int NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL = 100;


  if (result != NULL)
  {
    result = packed_string_float_component_release_memory (result);
  }
  min    = NULL;
  middle = NULL;
  max    = NULL;
  power  = NULL;
  constant_0 = NULL;
  constant_2 = NULL;
  numerator  = NULL;
  constant_0 = packed_string_float_set_value (constant_0, "0");
  constant_2 = packed_string_float_set_value (constant_2, "2");
  if ((input_number != NULL) && (constant_0 != NULL) && (constant_2 != NULL))
  {
    max = packed_string_float_copy_number (max, input_number);
    min = packed_string_float_copy_number (min, input_number);
    min = packed_string_float_set_sign (min, negative);
    numerator = packed_string_float_add (numerator, min, max);
    middle = packed_string_float_divide (middle, numerator, constant_2, NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL);
    power = packed_string_float_power (power, middle, n);
    num_iterations = 0;
    while (num_iterations < MAX_ITERATIONS) 
    {
      num_iterations++;
      difference_less_than = packed_string_float_less_than (power, input_number);
      switch (difference_less_than)
      {
        case 0:
          max = packed_string_float_component_release_memory (max);
          max = packed_string_float_copy_number (max, middle);
        break;
        case 1:
          min = packed_string_float_component_release_memory (min);
          min = packed_string_float_copy_number (min, middle);
        break;
        default:
        break;
      }
      power     = packed_string_float_component_release_memory (power);
      numerator = packed_string_float_component_release_memory (numerator);
      middle    = packed_string_float_component_release_memory (middle);
      numerator = packed_string_float_add (numerator, min, max);
      middle    = packed_string_float_divide (middle, numerator, constant_2, NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL);
      power     = packed_string_float_power (power, middle, n);
    }
  }
  if (constant_0 != NULL)
  {
    constant_0 = packed_string_float_release_memory (constant_0);
  }
  if (constant_2 != NULL)
  {
    constant_2 = packed_string_float_release_memory (constant_2);
  }
  if (min != NULL)
  {
    min = packed_string_float_release_memory (min);
  }
  if (max != NULL)
  {
    max = packed_string_float_release_memory (max);
  }
  if (power != NULL)
  {
    power = packed_string_float_release_memory (power);
  }
  if (numerator != NULL)
  {
    numerator = packed_string_float_release_memory (numerator);
  }
  return middle;
}




// **************************************************************************************************************************
// * packed_string_float_nth_root_with_newton_raphson_method                                                                *
// *                                                                                                                        *
// * This function determines the nth root of an input string-based floating-point number using Newton-Raphson method. This *
// * subroutine calls packed_string_float_nth_root_with_bisection_method to determine a close seed value for the nth root.  *
// **************************************************************************************************************************
psflt * packed_string_float_nth_root_with_newton_raphson_method (psflt *result, psflt *input_number, unsigned long long int n)
{
  psflt *xPre, *xK, *psf_n, *psf_n_minus_one, *constant_1; 
  psflt *temp1, *temp2, *temp3, *temp4;
  char n_string[64];
  unsigned long long int n_minus_one;
  int num_iterations;
  const int MAX_ITERATIONS = 1;
  const unsigned long long int NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL = 1000;

  
  if (result != NULL)
  {
    result = packed_string_float_component_release_memory (result);
  }
  temp1 = NULL;
  temp2 = NULL;
  temp3 = NULL;
  temp4 = NULL;
  xPre  = NULL;
  xK    = NULL;
  psf_n = NULL;           // psf_n = packed string float for input number n
  psf_n_minus_one = NULL; // psf_n = packed_string_float stroing n - 1
  constant_1 = NULL;
  constant_1 = packed_string_float_set_value (constant_1, "1");
  if ((input_number != NULL) && (constant_1 != NULL))
  {
    if (n > 1)
    {
      xK = packed_string_float_initialize_to_zero (xK);
      snprintf (&n_string[0], sizeof(n_string), "%lld", n);
      psf_n = packed_string_float_set_value (psf_n, &n_string[0]);
      if (psf_n != NULL)
      {
        n_minus_one = n - 1;
        psf_n_minus_one = packed_string_float_subtract (psf_n_minus_one, psf_n, constant_1);
        if (psf_n_minus_one != NULL)
        {
// ****************************************************************************************
// * Determine a fairly-accurate seed value for the initial nth root of the input number. *
// ****************************************************************************************
          xPre = _packed_string_float_determine_seed_value_for_newton_raphson_nth_root (xPre, input_number, n);

          //printf ("xPre = ");
          //packed_string_float_display (xPre, 0);
          //printf ("\n");
          //printf ("n = %lld\n", n);
          //printf ("n_minus_one = %lld\n", n_minus_one);
          //printf ("psf_n = ");
          //packed_string_float_display (psf_n, 0);
          //printf ("\n");
          //printf ("psf_n_minus_one = ");
          //packed_string_float_display (psf_n_minus_one, 0);
          //printf ("\n");
          num_iterations = 0;
          while (num_iterations < MAX_ITERATIONS)
          {
            num_iterations++;
            //printf ("\niteration: %d of %d\n", num_iterations, MAX_ITERATIONS);
            temp1 = packed_string_float_multiply (temp1, xPre, psf_n_minus_one);
            temp2 = packed_string_float_power (temp2, xPre, n_minus_one);
            temp3 = packed_string_float_divide (temp3, input_number, temp2, NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL);
            temp4 = packed_string_float_add (temp4, temp1, temp3); 
            xK = packed_string_float_divide (xK, temp4, psf_n, NUM_DIGITS_OF_PRECISION_RIGHT_OF_DECIMAL);

            //printf ("xK = ");
            //packed_string_float_display (xK, 0);
            //printf ("\n");

            xPre = packed_string_float_component_release_memory (xPre);
            xPre = packed_string_float_copy_number (xPre, xK);
            temp1 = packed_string_float_release_memory (temp1);
            temp2 = packed_string_float_release_memory (temp2);
            temp3 = packed_string_float_release_memory (temp3);
            temp4 = packed_string_float_release_memory (temp4);
          }
        }
      }     
    }
  } 
  return xK;
}




psflt * convert_packed_string_float_to_scientific_notation (psflt *packed_string_float_input_number)
{
  psflt *packed_string_float_exponent_notation;
  enum string_number_sign packed_string_float_exponent_notation_sign;
  psnc  *converted_packed_string_float_left_of_decimal, *converted_packed_string_float_right_of_decimal;
  psnc *temp_number_right_of_decimal, *temp_number_left_of_decimal;
  psint *exponent, *constant_integer_two, *constant_integer_one, *constant_integer_zero, *temp_sum;
  long long int i;
  unsigned char packed_byte, repacked_byte, nibble_low, nibble_high, found_zero_digit;
  int state;

  temp_sum              = NULL;
  constant_integer_zero = NULL;
  constant_integer_two  = NULL;
  constant_integer_one  = NULL;
  exponent              = NULL;
  packed_string_float_exponent_notation = NULL;
  converted_packed_string_float_left_of_decimal  = NULL;
  converted_packed_string_float_right_of_decimal = NULL;
  exponent  = packed_string_integer_initialize_to_zero (exponent);
  constant_integer_zero = packed_string_integer_initialize_to_zero (constant_integer_zero);
  constant_integer_one = packed_string_integer_set_value (constant_integer_one, "1");
  constant_integer_two = packed_string_integer_set_value (constant_integer_two, "2");
  if ((packed_string_float_input_number != NULL) && (constant_integer_one != NULL) && (constant_integer_two != NULL))
  {
    if (packed_string_float_input_number->left_of_decimal != NULL)
    {
      if (packed_string_float_input_number->left_of_decimal->last_number_block != NULL)
      {
        state = 0;
        temp_number_left_of_decimal = packed_string_float_input_number->left_of_decimal->last_number_block;
        found_zero_digit = TRUE;
        while ((temp_number_left_of_decimal != NULL) && (found_zero_digit))
        {
          i = temp_number_left_of_decimal->highest_digit_position;
          if (i < MAX_PACKED_NUMBER_BLOCK_SIZE)
          {
            while ((i >= 0) && (found_zero_digit))
            {
              packed_byte = temp_number_left_of_decimal->packed_number_block[i];
              nibble_low  = packed_byte & 0x0f;
              nibble_high = (packed_byte & 0xf0) >> 4;
              if ((nibble_high >= 1) && (nibble_high <= 9))
              {
                state = 10;
                converted_packed_string_float_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_packed_string_float_left_of_decimal, nibble_high); 
                converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, nibble_low); 
// *************************************************************************************************************
// * High nibble and low nibble counts as one digit since we must role the decimal only one place to the left. *
// *************************************************************************************************************
                temp_sum = packed_string_integer_copy_number (temp_sum, exponent); 
                exponent = packed_string_integer_release_memory (exponent);
                exponent = packed_string_integer_add (exponent, temp_sum, constant_integer_one);
                temp_sum = packed_string_integer_release_memory (temp_sum);
                found_zero_digit = FALSE;
              }
              else
              {
                if ((nibble_low >= 1) && (nibble_low <= 9))
                {
                  state = 20;
                  converted_packed_string_float_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_packed_string_float_left_of_decimal, nibble_low); 
                  found_zero_digit = FALSE;
                }
              }
              i--;
            }
          }
          if (found_zero_digit)
          {
            temp_number_left_of_decimal = temp_number_left_of_decimal->previous_number_block;
          }
        }
        if (found_zero_digit == FALSE)
        {
          if (temp_number_left_of_decimal != NULL)
          {
            while (i >= 0)
            {
              packed_byte = temp_number_left_of_decimal->packed_number_block[i];
              switch (state)
              {
                case 10:
                  nibble_low = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
// **************************************************************************************************************************************
// * I am purposefully shifting digits from LEFT side of decimal to RIGHT side since I'm converting the decimal to scientific notation. *
// **************************************************************************************************************************************
                  converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, nibble_high); 
                  converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, nibble_low); 
                break;
                case 20:  
                  nibble_low = packed_byte & 0x0f;
                  nibble_high = (packed_byte & 0xf0) >> 4;
                  repacked_byte = (nibble_low << 4) + nibble_high;
                  converted_packed_string_float_right_of_decimal = packed_string_float_append_two_digits_right_of_decimal (converted_packed_string_float_right_of_decimal, repacked_byte);
                break;
                default:
                break;
              }
              temp_sum = packed_string_integer_copy_number (temp_sum, exponent); 
              exponent = packed_string_integer_release_memory (exponent);
              exponent = packed_string_integer_add (exponent, temp_sum, constant_integer_two);
              temp_sum = packed_string_integer_release_memory (temp_sum);
              i--;
            }
            temp_number_left_of_decimal = temp_number_left_of_decimal->previous_number_block;
            while (temp_number_left_of_decimal != NULL)
            {
              i = MAX_PACKED_NUMBER_BLOCK_SIZE - 1;
              while (i >= 0)
              {
                packed_byte = temp_number_left_of_decimal->packed_number_block[i];
                switch (state)
                {
                  case 10:
                    converted_packed_string_float_right_of_decimal = packed_string_float_append_two_digits_right_of_decimal (converted_packed_string_float_right_of_decimal, packed_byte);
                  break;
                  case 20:  
                    nibble_low = packed_byte & 0x0f;
                    nibble_high = (packed_byte & 0xf0) >> 4;
                    repacked_byte = (nibble_high << 4) + nibble_low;
                    converted_packed_string_float_right_of_decimal = packed_string_float_append_two_digits_right_of_decimal (converted_packed_string_float_right_of_decimal, repacked_byte);
                  break;
                  default:
                  break;
                }
                temp_sum = packed_string_integer_copy_number (temp_sum, exponent); 
                exponent = packed_string_integer_release_memory (exponent);
                exponent = packed_string_integer_add (exponent, temp_sum, constant_integer_two);
                temp_sum = packed_string_integer_release_memory (temp_sum);
                i--;
              }
              temp_number_left_of_decimal = temp_number_left_of_decimal->previous_number_block;
            }
          }
        }
      }
    }
    if (packed_string_float_input_number->right_of_decimal != NULL)
    {
      if (packed_string_float_input_number->right_of_decimal->last_number_block != NULL)
      {
// ********************************************************
// * Advance to least significant digit Right of decimal. *
// ********************************************************
        temp_number_right_of_decimal = packed_string_float_input_number->right_of_decimal->last_number_block;
        found_zero_digit = TRUE;
        while ((temp_number_right_of_decimal != NULL) && (found_zero_digit))
        {
          i = MAX_PACKED_NUMBER_BLOCK_SIZE - 1;
          while ((i >= 0) && (found_zero_digit))
          {
            packed_byte = temp_number_right_of_decimal->packed_number_block[i];
            nibble_low  = packed_byte & 0x0f;
            nibble_high = (packed_byte & 0xf0) >> 4;
            if ((nibble_high >= 1) && (nibble_high <= 9))
            {
              found_zero_digit = FALSE;
            }
            else
            {
              if ((nibble_low >= 1) && (nibble_low <= 9))
              {
                found_zero_digit = FALSE;
              }
            }
            i--;
          }
          if (found_zero_digit)
          {
            temp_number_right_of_decimal = temp_number_right_of_decimal->previous_number_block;
          }
        }
        if (found_zero_digit == FALSE)
        {
          temp_number_right_of_decimal = packed_string_float_input_number->right_of_decimal->first_number_block;
          while (temp_number_right_of_decimal != NULL)
          {
            if (temp_number_right_of_decimal->highest_digit_position < MAX_PACKED_NUMBER_BLOCK_SIZE)
            {
              i = 0;
              while (i <= temp_number_right_of_decimal->highest_digit_position)
              {
                packed_byte = temp_number_right_of_decimal->packed_number_block[i];
                nibble_low  = packed_byte & 0x0f;
                nibble_high = (packed_byte & 0xf0) >> 4;
                converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, nibble_low); 
                converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, nibble_high); 
                i++;
              }
            }
            else
            {
              printf ("convert_packed_string_float_to_exponent_notation failed: highest digit position right of floating point number exceeds MAX_PACKED NUMBER BLOCK SIZE. Exiting now.\n"); 
              exit (0);
            }
            temp_number_right_of_decimal = temp_number_right_of_decimal->next_number_block;
          }
        }
      }
    }
  }
  packed_string_float_exponent_notation_sign = positive;
  if ((converted_packed_string_float_left_of_decimal == NULL) && (converted_packed_string_float_right_of_decimal == NULL))
  {
    packed_string_float_exponent_notation_sign = zero;
  }
  else
  {
    if (packed_string_float_input_number != NULL)
    {
      packed_string_float_exponent_notation_sign = packed_string_float_input_number->sign;
    } 
  }
  if (converted_packed_string_float_left_of_decimal == NULL)
  {
    converted_packed_string_float_left_of_decimal = packed_string_float_append_one_digit_left_of_decimal (converted_packed_string_float_left_of_decimal, 0); 
  }
  if (converted_packed_string_float_right_of_decimal == NULL)
  {
    converted_packed_string_float_right_of_decimal = packed_string_float_append_one_digit_right_of_decimal (converted_packed_string_float_right_of_decimal, 0); 
  }
  if ((converted_packed_string_float_left_of_decimal != NULL) && (converted_packed_string_float_right_of_decimal != NULL))
  {
    packed_string_float_exponent_notation = (psflt *) malloc(sizeof(psflt));
    if (packed_string_float_exponent_notation != NULL)
    {
      packed_string_float_exponent_notation->sign = packed_string_float_exponent_notation_sign;
      packed_string_float_exponent_notation->left_of_decimal  = converted_packed_string_float_left_of_decimal;
      packed_string_float_exponent_notation->right_of_decimal = converted_packed_string_float_right_of_decimal;
      //packed_string_float_exponent_notation->exponent = exponent;
      packed_string_float_exponent_notation->status_flag = 0;
    }
  }
  return packed_string_float_exponent_notation;
}





unsigned char is_packed_string_float_in_scientific_notation_format (psflt *packed_string_float_input_number)
{
  psnc *temp_number_left_of_decimal;
  unsigned char nibble_low, input_number_left_of_decimal_is_single_digit, input_number_is_in_scientific_notation, input_number_has_valid_exponent;

  input_number_left_of_decimal_is_single_digit = FALSE;
  input_number_is_in_scientific_notation       = FALSE;
  input_number_has_valid_exponent              = FALSE;
  if (packed_string_float_input_number != NULL)
  {
    if (packed_string_float_input_number->left_of_decimal != NULL)
    {
      if (packed_string_float_input_number->left_of_decimal->first_number_block != NULL)
      {
        temp_number_left_of_decimal = packed_string_float_input_number->left_of_decimal->first_number_block;
        if ((temp_number_left_of_decimal->highest_digit_position == 0) && (temp_number_left_of_decimal->highest_nibble_position == lo))
        {
          nibble_low = temp_number_left_of_decimal->packed_number_block[0] & 0x0f;
          if ((nibble_low >= 0) && (nibble_low <= 9))
          {
            input_number_left_of_decimal_is_single_digit = TRUE; 
          }
        }
      }
      //if (packed_string_float_input_number->exponent != NULL)
      //{
      //  exponent = packed_string_float_input_number->exponent;
      //  if (exponent->sign == zero)
      //  {
      //    input_number_has_valid_exponent = TRUE; 
      //  }
      //  else
      //  {
      //    if (exponent->left_of_decimal != NULL)
      //    {
      //      input_number_has_valid_exponent = TRUE;
      //    }
      //  }
      //}
    }
  }  
  if (input_number_left_of_decimal_is_single_digit)
  {
    if (input_number_has_valid_exponent)
    {
      input_number_is_in_scientific_notation = TRUE;
    }
  } 
  return input_number_is_in_scientific_notation;
}




// ***********************************************************************************************
// * packed_string_float_truncate_to_packed_string_integer                                       *
// *                                                                                             *
// * This subroutine converts a packed_string float into a packed string integer by truncating   *
// * the packed string float input number RIGHT of DECIMAL. This subroutine only copies a packed *
// * string float LEFT of DECIMAL. The RIGHT of DECIMAL component is completely discarded in the *
// * conversion process.                                                                         *
// *                                                                                             *
// * Input: a packed string float datatype.                                                      *
// * Output: a packed string integer datatype.                                                   *
// ***********************************************************************************************
psint * packed_string_float_truncate_to_packed_string_integer (psint *truncated_number_copy, psflt *input_number)
{
  psnc *new_number_block_left_of_decimal, *truncated_number_copy_previous_left_of_decimal, *temp_num_left_of_decimal;
  unsigned char packed_digits, nibble_lo;
  long long int i;
  int state;

// *************************************************************************
// * Release any previously used memory otherwise we'd have a memory leak. *
// *************************************************************************
  if (truncated_number_copy != NULL)
  {
    truncated_number_copy = packed_string_integer_component_release_memory (truncated_number_copy); // release the LEFT of DECIMAL number component (if exists) since initializing to zero requires LEFT of DECIMAL number component to be NULL;
  }
  if (input_number != NULL)
  {
    if (input_number->left_of_decimal != NULL)
    {
      if (truncated_number_copy == NULL)
      {
        truncated_number_copy = (psint *) malloc(sizeof(psint));
      }
      if (truncated_number_copy != NULL)
      {
        truncated_number_copy->sign = input_number->sign;
        truncated_number_copy->status_flag = NONE;
        truncated_number_copy->left_of_decimal  = NULL;
// ********************************
// * Copy number LEFT of decimal. *
// ********************************
        new_number_block_left_of_decimal = NULL;
        truncated_number_copy_previous_left_of_decimal = NULL;
        state = 0;
        temp_num_left_of_decimal = input_number->left_of_decimal;
        while (temp_num_left_of_decimal != NULL)
        {
          new_number_block_left_of_decimal = (psnc *) malloc(sizeof(psnc));
          if (new_number_block_left_of_decimal != NULL)
          {
            new_number_block_left_of_decimal->highest_digit_position = temp_num_left_of_decimal->highest_digit_position;
            new_number_block_left_of_decimal->first_number_block     = NULL;
            new_number_block_left_of_decimal->last_number_block      = NULL;
            new_number_block_left_of_decimal->previous_number_block  = NULL;
            new_number_block_left_of_decimal->next_number_block      = NULL;
            for (i = temp_num_left_of_decimal->highest_digit_position + 1; i < MAX_PACKED_NUMBER_BLOCK_SIZE; i++)
            {
              new_number_block_left_of_decimal->packed_number_block[i] = 0;
            }
            for (i = 0; i < temp_num_left_of_decimal->highest_digit_position; i++)
            {
              new_number_block_left_of_decimal->packed_number_block[i] = temp_num_left_of_decimal->packed_number_block[i];
            }
            if (temp_num_left_of_decimal->highest_nibble_position == hi)
            {
              new_number_block_left_of_decimal->highest_nibble_position = hi;
              new_number_block_left_of_decimal->packed_number_block[i] = temp_num_left_of_decimal->packed_number_block[i];
            }
            else
            {
              packed_digits = temp_num_left_of_decimal->packed_number_block[i];
              nibble_lo = packed_digits & 0x0f;
              new_number_block_left_of_decimal->highest_nibble_position = lo;
              new_number_block_left_of_decimal->packed_number_block[i] = nibble_lo;
            }
            switch (state)
            {
              case 0:
                truncated_number_copy->left_of_decimal = new_number_block_left_of_decimal;
                truncated_number_copy->left_of_decimal->first_number_block = truncated_number_copy->left_of_decimal;
                truncated_number_copy->left_of_decimal->previous_number_block = NULL;
                state = 10;
              break;
              case 10:
                if (truncated_number_copy_previous_left_of_decimal != NULL)
                {
                  truncated_number_copy_previous_left_of_decimal->next_number_block = new_number_block_left_of_decimal;
                }
                new_number_block_left_of_decimal->first_number_block    = truncated_number_copy->left_of_decimal;
                new_number_block_left_of_decimal->previous_number_block = truncated_number_copy_previous_left_of_decimal; 
              break;
              default:
              break;
            }
            truncated_number_copy_previous_left_of_decimal = new_number_block_left_of_decimal;
          }
          temp_num_left_of_decimal = temp_num_left_of_decimal->next_number_block;
        }
        if (truncated_number_copy->left_of_decimal != NULL)
        {
          if (new_number_block_left_of_decimal != NULL)
          {
            temp_num_left_of_decimal = truncated_number_copy->left_of_decimal;
            while (temp_num_left_of_decimal != NULL)
            {
              temp_num_left_of_decimal->last_number_block = new_number_block_left_of_decimal;
              temp_num_left_of_decimal = temp_num_left_of_decimal->next_number_block;
            }
          }
        }
      }
    }
    else
    {
      if (input_number->sign == undefined)
      {
        truncated_number_copy = packed_string_integer_initialize_to_undefined (truncated_number_copy);
      }
      else
      {
        truncated_number_copy = packed_string_integer_initialize_to_zero (truncated_number_copy);
      }
    }
  }
  return truncated_number_copy;
}




unsigned char * convert_packed_string_float_to_boolean (psflt *num1)
{
  psflt *constant_one;
  unsigned char *converted_bool_value;
  int greater_number;

  constant_one = NULL;
  constant_one = packed_string_float_set_value (constant_one, "1");
  converted_bool_value = NULL;
  if ((num1 != NULL) && (constant_one != NULL))
  {
    greater_number = packed_string_float_determine_absolute_value_larger_of_two_floats (num1, constant_one);
    switch (greater_number)
    {
      case 1: // |num1| > |num2|.
        converted_bool_value = (unsigned char *) malloc(sizeof(unsigned char));
        if (converted_bool_value != NULL)
        {
          *converted_bool_value = TRUE;
        }
      break;
      case 0: // |num1| == |num2|
        converted_bool_value = (unsigned char *) malloc(sizeof(unsigned char));
        if (converted_bool_value != NULL)
        {
          *converted_bool_value = TRUE;
        }
      break;
      case -1: // num1 < num2
        converted_bool_value = (unsigned char *) malloc(sizeof(unsigned char));
        if (converted_bool_value != NULL)
        {
          if (num1->sign == zero)
          {
            *converted_bool_value = FALSE;
          }
          else
          {
            *converted_bool_value = TRUE;
          }
        }
      break;
      case -2:
      break;
      default:
      break;
    }
    constant_one = packed_string_float_release_memory (constant_one);
  }
  return converted_bool_value;
}




psflt * convert_boolean_to_packed_string_float (unsigned char *boolean_value)
{
  psflt *converted_float_value;

  converted_float_value = NULL;
  if (boolean_value != NULL)
  {
    if (*boolean_value == FALSE)
    {
      converted_float_value = packed_string_float_set_value (converted_float_value, "0");
    }
    else
    {
      if (*boolean_value == TRUE)
      {
        converted_float_value = packed_string_float_set_value (converted_float_value, "1");
      }
    }
  }
  return converted_float_value;
}
