function van_der_corput_key_set ( key )

%*****************************************************************************80
%
%% van_der_corput_key_set() sets the key of the van der Corput sequence.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 February 2003
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Johannes van der Corput,
%    Verteilungsfunktionen I and II,
%    Nederl. Akad. Wetensch. Proc.,
%    Volume 38, 1935, pages 813-820, pages 1058-1066.
%
%  Input:
%
%    integer key, the new value for the key.  key should be
%    nonnegative.  Only the integer part of key is used.  key = 0
%    is allowed, and returns R = 0.
%
%  Global:
%
%    integer VAN_DER_CORPUT_BASE, the current base.
%
%    integer VAN_DER_CORPUT_key, the current key.
%
  global van_der_corput_BASE
  global van_der_corput_key
%
  if ( key < 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'VAN_DER_CORPUT_key_SET - Fatal error!\n' );
    fprintf ( 1, '  Input value of key < 0!\n' );
    fprintf ( 1, '  key = %d\n', key );
    return
  end

  van_der_corput_key = floor ( key );

  return
end
