// Copyright, 2001-2003, Astra Network Inc.  All Rights Reserved

// This source code has been published by Astra Network Inc. However, any
// use, reproduction, modification, distribution or transfer of this
// software, or any software which includes or is based upon any of this
// code, is only permitted if expressly authorized by a written license
// agreement from Astra. Contact your Astra representative directly for
// more information.

#include <stdio.h>
#include <quad.h>
#include <time.h>

int
main (int argc, char *argv[])
{
  ___quad_t a;

  a = LTOQ (1);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (10);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (100);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (1000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (10000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (100000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (1000000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (10000000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-1);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-10);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-100);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-1000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-10000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-100000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-1000000);
  printf ("%s\n", QTOSTR (a));
  a = LTOQ (-10000000);
  printf ("%s\n", QTOSTR (a));

  a.v[H] = 1;
  a.v[L] = 0;
  printf ("%s\n", QTOSTR (a));

  a.v[H] = LONG_MAX;
  a.v[L] = ULONG_MAX;
  printf ("%s\n", QTOSTR (a));

  a.v[H] = 0x80000000;
  a.v[L] = 1;
  printf ("%s\n", QTOSTR (a));

  printf ("\ntesting quad_strtoq now\n\n");

  a = STRTOQ ("1");
  printf ("%s\n", QTOSTR (a));
  a = STRTOQ ("10");
  printf ("%s\n", QTOSTR (a));

  a = STRTOQ ("9223372036854775807");
  printf ("%s\n", QTOSTR (a));

  a = STRTOQ ("-9223372036854775807");
  printf ("%s\n", QTOSTR (a));
}
