function value = year_is_leap_gregorian ( y )

%*****************************************************************************80
%
%% year_is_leap_gregorian() returns true if the Gregorian year was a leap year.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 September 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer Y, the year.
%
%  Output:
%
%    Output, logical VALUE, true if the year was a leap year.
%
  if ( y == 0 )
    value = false;
    return
  end
%
%  BC years have to have 1 added to them to make a proper leap year evaluation.
%
  y2 = y_common_to_astronomical ( y );

  if ( mod ( y2, 400 ) == 0 )
    value = true;
  elseif ( mod ( y2, 100 ) == 0 )
    value = false;
  elseif ( mod ( y2, 4 ) == 0 )
    value = true;
  else
    value = false;
  end

  return
end
