# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0.  If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.

# This file was generated by using the script sql_decimal_hge.mal.sh.

command calc.hge(v:flt, digits:int, scale:int) :hge
address flt_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:flt], digits:int, scale:int) :bat[:hge]
address batflt_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(v:dbl, digits:int, scale:int) :hge
address dbl_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:dbl], digits:int, scale:int) :bat[:hge]
address batdbl_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(v:bte, digits:int, scale:int) :hge
address bte_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:bte], digits:int, scale:int) :bat[:hge]
address batbte_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(s1:int, v:bte) :hge
address bte_dec2_hge
comment "cast decimal(bte) to hge and check for overflow";
command calc.hge(s1:int, v:bte, d2:int, s2:int) :hge
address bte_dec2dec_hge
comment "cast decimal(bte) to decimal(hge) and check for overflow";

command batcalc.hge(s1:int, v:bat[:bte]) :bat[:hge]
address batbte_dec2_hge
comment "cast decimal(bte) to hge and check for overflow";
command batcalc.hge(s1:int, v:bat[:bte], d2:int, s2:int) :bat[:hge]
address batbte_dec2dec_hge
comment "cast decimal(bte) to decimal(hge) and check for overflow";

command calc.hge(v:sht, digits:int, scale:int) :hge
address sht_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:sht], digits:int, scale:int) :bat[:hge]
address batsht_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(s1:int, v:sht) :hge
address sht_dec2_hge
comment "cast decimal(sht) to hge and check for overflow";
command calc.hge(s1:int, v:sht, d2:int, s2:int) :hge
address sht_dec2dec_hge
comment "cast decimal(sht) to decimal(hge) and check for overflow";

command batcalc.hge(s1:int, v:bat[:sht]) :bat[:hge]
address batsht_dec2_hge
comment "cast decimal(sht) to hge and check for overflow";
command batcalc.hge(s1:int, v:bat[:sht], d2:int, s2:int) :bat[:hge]
address batsht_dec2dec_hge
comment "cast decimal(sht) to decimal(hge) and check for overflow";

command calc.hge(v:int, digits:int, scale:int) :hge
address int_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:int], digits:int, scale:int) :bat[:hge]
address batint_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(s1:int, v:int) :hge
address int_dec2_hge
comment "cast decimal(int) to hge and check for overflow";
command calc.hge(s1:int, v:int, d2:int, s2:int) :hge
address int_dec2dec_hge
comment "cast decimal(int) to decimal(hge) and check for overflow";

command batcalc.hge(s1:int, v:bat[:int]) :bat[:hge]
address batint_dec2_hge
comment "cast decimal(int) to hge and check for overflow";
command batcalc.hge(s1:int, v:bat[:int], d2:int, s2:int) :bat[:hge]
address batint_dec2dec_hge
comment "cast decimal(int) to decimal(hge) and check for overflow";

command calc.hge( v:lng, digits:int, scale:int ) :hge
address lng_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:lng], digits:int, scale:int) :bat[:hge]
address batlng_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(s1:int, v:lng) :hge
address lng_dec2_hge
comment "cast decimal(lng) to hge and check for overflow";
command calc.hge(s1:int, v:lng, d2:int, s2:int) :hge
address lng_dec2dec_hge
comment "cast decimal(lng) to decimal(hge) and check for overflow";

command batcalc.hge(s1:int, v:bat[:lng]) :bat[:hge]
address batlng_dec2_hge
comment "cast decimal(lng) to hge and check for overflow";
command batcalc.hge(s1:int, v:bat[:lng], d2:int, s2:int) :bat[:hge]
address batlng_dec2dec_hge
comment "cast decimal(lng) to decimal(hge) and check for overflow";

command calc.hge(v:hge, digits:int, scale:int) :hge
address hge_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command batcalc.hge(v:bat[:hge], digits:int, scale:int) :bat[:hge]
address bathge_num2dec_hge
comment "cast number to decimal(hge) and check for overflow";

command calc.hge(s1:int, v:hge) :hge
address hge_dec2_hge
comment "cast decimal(hge) to hge and check for overflow";
command calc.hge(s1:int, v:hge, d2:int, s2:int) :hge
address hge_dec2dec_hge
comment "cast decimal(hge) to decimal(hge) and check for overflow";

command batcalc.hge(s1:int, v:bat[:hge]) :bat[:hge]
address bathge_dec2_hge
comment "cast decimal(hge) to hge and check for overflow";
command batcalc.hge(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:hge]
address bathge_dec2dec_hge
comment "cast decimal(hge) to decimal(hge) and check for overflow";

command calc.bte(v:hge, digits:int, scale:int) :bte
address hge_num2dec_bte
comment "cast number to decimal(bte) and check for overflow";

command batcalc.bte(v:bat[:hge], digits:int, scale:int) :bat[:bte]
address bathge_num2dec_bte
comment "cast number to decimal(bte) and check for overflow";

command calc.bte(s1:int, v:hge) :bte
address hge_dec2_bte
comment "cast decimal(hge) to bte and check for overflow";
command calc.bte(s1:int, v:hge, d2:int, s2:int) :bte
address hge_dec2dec_bte
comment "cast decimal(hge) to decimal(bte) and check for overflow";

command batcalc.bte(s1:int, v:bat[:hge]) :bat[:bte]
address bathge_dec2_bte
comment "cast decimal(hge) to bte and check for overflow";
command batcalc.bte(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:bte]
address bathge_dec2dec_bte
comment "cast decimal(hge) to decimal(bte) and check for overflow";

command calc.sht(v:hge, digits:int, scale:int) :sht
address hge_num2dec_sht
comment "cast number to decimal(sht) and check for overflow";

command batcalc.sht(v:bat[:hge], digits:int, scale:int) :bat[:sht]
address bathge_num2dec_sht
comment "cast number to decimal(sht) and check for overflow";

command calc.sht(s1:int, v:hge) :sht
address hge_dec2_sht
comment "cast decimal(hge) to sht and check for overflow";
command calc.sht(s1:int, v:hge, d2:int, s2:int) :sht
address hge_dec2dec_sht
comment "cast decimal(hge) to decimal(sht) and check for overflow";

command batcalc.sht(s1:int, v:bat[:hge]) :bat[:sht]
address bathge_dec2_sht
comment "cast decimal(hge) to sht and check for overflow";
command batcalc.sht(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:sht]
address bathge_dec2dec_sht
comment "cast decimal(hge) to decimal(sht) and check for overflow";

command calc.int(v:hge, digits:int, scale:int) :int
address hge_num2dec_int
comment "cast number to decimal(int) and check for overflow";

command batcalc.int(v:bat[:hge], digits:int, scale:int) :bat[:int]
address bathge_num2dec_int
comment "cast number to decimal(int) and check for overflow";

command calc.int(s1:int, v:hge) :int
address hge_dec2_int
comment "cast decimal(hge) to int and check for overflow";
command calc.int(s1:int, v:hge, d2:int, s2:int) :int
address hge_dec2dec_int
comment "cast decimal(hge) to decimal(int) and check for overflow";

command batcalc.int(s1:int, v:bat[:hge]) :bat[:int]
address bathge_dec2_int
comment "cast decimal(hge) to int and check for overflow";
command batcalc.int(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:int]
address bathge_dec2dec_int
comment "cast decimal(hge) to decimal(int) and check for overflow";

command calc.lng( v:hge, digits:int, scale:int ) :lng
address hge_num2dec_lng
comment "cast number to decimal(lng) and check for overflow";

command batcalc.lng(v:bat[:hge], digits:int, scale:int) :bat[:lng]
address bathge_num2dec_lng
comment "cast number to decimal(lng) and check for overflow";

command calc.lng(s1:int, v:hge) :lng
address hge_dec2_lng
comment "cast decimal(hge) to lng and check for overflow";
command calc.lng(s1:int, v:hge, d2:int, s2:int) :lng
address hge_dec2dec_lng
comment "cast decimal(hge) to decimal(lng) and check for overflow";

command batcalc.lng(s1:int, v:bat[:hge]) :bat[:lng]
address bathge_dec2_lng
comment "cast decimal(hge) to lng and check for overflow";
command batcalc.lng(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:lng]
address bathge_dec2dec_lng
comment "cast decimal(hge) to decimal(lng) and check for overflow";

command calc.flt(v:hge, digits:int, scale:int) :flt
address hge_num2dec_flt
comment "cast number to decimal(flt) and check for overflow";

command batcalc.flt(v:bat[:hge], digits:int, scale:int) :bat[:flt]
address bathge_num2dec_flt
comment "cast number to decimal(flt) and check for overflow";

command calc.flt(s1:int, v:hge) :flt
address hge_dec2_flt
comment "cast decimal(hge) to flt and check for overflow";
command calc.flt(s1:int, v:hge, d2:int, s2:int) :flt
address hge_dec2dec_flt
comment "cast decimal(hge) to decimal(flt) and check for overflow";

command batcalc.flt(s1:int, v:bat[:hge]) :bat[:flt]
address bathge_dec2_flt
comment "cast decimal(hge) to flt and check for overflow";
command batcalc.flt(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:flt]
address bathge_dec2dec_flt
comment "cast decimal(hge) to decimal(flt) and check for overflow";

command calc.dbl(v:hge, digits:int, scale:int) :dbl
address hge_num2dec_dbl
comment "cast number to decimal(dbl) and check for overflow";

command batcalc.dbl(v:bat[:hge], digits:int, scale:int) :bat[:dbl]
address bathge_num2dec_dbl
comment "cast number to decimal(dbl) and check for overflow";

command calc.dbl(s1:int, v:hge) :dbl
address hge_dec2_dbl
comment "cast decimal(hge) to dbl and check for overflow";
command calc.dbl(s1:int, v:hge, d2:int, s2:int) :dbl
address hge_dec2dec_dbl
comment "cast decimal(hge) to decimal(dbl) and check for overflow";

command batcalc.dbl(s1:int, v:bat[:hge]) :bat[:dbl]
address bathge_dec2_dbl
comment "cast decimal(hge) to dbl and check for overflow";
command batcalc.dbl(s1:int, v:bat[:hge], d2:int, s2:int) :bat[:dbl]
address bathge_dec2dec_dbl
comment "cast decimal(hge) to decimal(dbl) and check for overflow";

