%%
%% This is file `babel-ca-indian.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% babel.dtx  (with options: `ca-indian')
%% 
%%
%% Copyright (C) 2012-2026 Javier Bezos and Johannes L. Braams.
%% Copyright (C) 1989-2012 Johannes L. Braams and
%%           any individual authors listed elsewhere in this file.
%% All rights reserved.
%%
%%
%% This file is part of the Babel system.
%% --------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% The Current Maintainer of this work is Javier Bezos.
%%
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension |.ins|) which are part of the distribution.
%%
\def\bbl@fpmod#1#2{(#1-#2*floor((#1)/(#2)))}
\def\bbl@cs@gregleap#1{%
  (\bbl@fpmod{#1}{4} == 0) &&
    (!((\bbl@fpmod{#1}{100} == 0) && (\bbl@fpmod{#1}{400} != 0)))}
\def\bbl@cs@jd#1#2#3{% year, month, day
  \fpeval{ 1721424.5   + (365 * (#1 - 1)) +
    floor((#1 - 1) / 4)   + (-floor((#1 - 1) / 100)) +
    floor((#1 - 1) / 400) + floor((((367 * #2) - 362) / 12) +
    ((#2 <= 2) ? 0 : (\bbl@cs@gregleap{#1} ? -1 : -2)) + #3) }}
\def\bbl@sakachaitra#1{%
  \bbl@cs@jd{#1}{3}{%
    \fpeval{ ((\bbl@fpmod{#1}{4}==0 && \bbl@fpmod{#1}{100}!=0)
    ||\bbl@fpmod{#1}{400}==0) ? 21 : 22 }}}
\def\bbl@ca@indian#1-#2-#3\@@#4#5#6{%
  \edef\bbl@tempa{\fpeval{\bbl@cs@jd{#1}{#2}{#3}}}%
  \edef\bbl@tempb{\fpeval{\bbl@sakachaitra{#1}}}%
  \edef\bbl@tempc{\fpeval{\bbl@tempa < \bbl@tempb ? #1-1 : #1}}%
  \edef\bbl@tempd{\fpeval{\bbl@tempa-\bbl@sakachaitra{\bbl@tempc}}}%
  \edef\bbl@tempe{\fpeval{ ((\bbl@fpmod{\bbl@tempc}{4}==0 &&
    \bbl@fpmod{\bbl@tempc}{100}!=0) || \bbl@fpmod{\bbl@tempc}{400}==0)?31:30}}%
  \edef#4{\fpeval{\bbl@tempc-78}}%
  \edef#5{\fpeval{\bbl@tempd<\bbl@tempe ? 1 :
    (\bbl@tempd-\bbl@tempe < 155 ?
      2+trunc((\bbl@tempd-\bbl@tempe)/31,0) :
      7+trunc((\bbl@tempd-\bbl@tempe-155)/30,0))}}%
  \edef#6{\fpeval{\bbl@tempd<\bbl@tempe ? \bbl@tempd+1 :
    (\bbl@tempd-\bbl@tempe < 155 ?
      \bbl@fpmod{\bbl@tempd-\bbl@tempe}{31}+1 :
      \bbl@fpmod{\bbl@tempd-\bbl@tempe-155}{30}+1)}}}
\endinput
%%
%% End of file `babel-ca-indian.tex'.
