FreeAdhocUDF for InterBase and FireBird in deutschin englishen françaisen españolin italianoa português
homeprevious pageÜbersicht • overview • aperçunext pagelast page Seite empfehlen • advice website •Forum mailing-listwas ich vermisse • what I missed •eMail Kommentar • eMail commentprintsitemap
 

Functions enclosed in FreeAdhocUDF.dll/.so/.dylib :
Numeric-functions 75 functions

Create 4 functions

Format 13 functions

Calculate 21 functions

Compare 4 functions

Binary functions 8 functions

Trigonometry 25 functions

since FireBird 2.1 this function is substitutable with a native SQL statement


Output RETURN mechanism if nothing other is published: FREE_IT
TestSQLs with NULL run only in FireBird 2.
 
Numeric-functions: Create
from substitutable with RAND
F_RAND input/output-compatibility to ib_udf
Entrypoint f_rand compatible with UTF-8
Input without

Output DOUBLE floatingpoint-random-number with value between 0 and 1
This function can create more than one different random-no. in one second because the generator is set with the actual systemtime and the process-ID, so that is is impossible, that 2 calls in the same second return the same random-no.
TestSQL
SELECT F_RAND() FROM RDB$DATABASE;
nach oben • go top •
F_INTRANDOM function from adhoc
Entrypoint intrandom compatible with UTF-8
Input INTEGER
INTEGER
min. value of random-no.
max. value of random-no.
Output INTEGER integer-random-no. with value between parameter 1 and parameter 2
This function can create more than one different random-no. in one second because the generator is set with the actual systemtime and the process-ID, so that is is impossible, that 2 calls in the same second return the same random-no.
TestSQL
SELECT F_INTRANDOM(100, 10000) FROM RDB$DATABASE;
SELECT F_INTRANDOM(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_GETRANDOM input/output-compatibility to rFunc (GETRANDOM)
Entrypoint getrandom compatible with UTF-8
Input INTEGER
max. number of random
Output INTEGER integer-random number between 0 and value of parameter 2
This function can create more than one different random-no. in one second because the generator is set with the actual systemtime and the process-ID, so that is is impossible, that 2 calls in the same second return the same random-no.
TestSQL
SELECT F_GETRANDOM(10000) FROM RDB$DATABASE;
SELECT F_GETRANDOM(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DOUBLERANDOM function from adhoc
Entrypoint doublerandom compatible with UTF-8
Input INTEGER
INTEGER
min. value of random-no.
max. value of random-no.
Output DOUBLE floatingpoint-random-number with value between parameter 1 and parameter 2
This function can create more than one different random-no. in one second because the generator is set with the actual systemtime and the process-ID, so that is is impossible, that 2 calls in the same second return the same random-no.
TestSQL
SELECT F_DOUBLERANDOM(100, 10000) FROM RDB$DATABASE;
SELECT F_DOUBLERANDOM(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Numeric-functions: Format
F_ROUND input/output-compatibility to FreeUDFLibC
Entrypoint f_round compatible with UTF-8
Input DOUBLE floatingpoint to be round as an integer
Output INTEGER integer
The method of rounding is the common method like F_ZAHLRUNDEN.
Because there is a same-named function in C we must change the entrypoint from round to f_round. Therefore now NO entryppoint-compatibility to FreeUDFLibC.
TestSQL
SELECT 16 AS ISCORRECT, F_ROUND(15.567) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ROUND(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ROUNDFLOAT compatibility FreeUDFLib, FreeUDFLib AvERP
Entrypoint roundfloat compatible with UTF-8
Input DOUBLE
DOUBLE
floatingpoint to be round
output pattern for floatingpoint (e.g. 0.01) rounds on the next multiple of    parameter 2
Output DOUBLE floatingpoint
TestSQL
SELECT 15.55 AS ISCORRECT, F_ROUNDFLOAT(15.567, 0.05) FROM RDB$DATABASE;
SELECT 15.56 AS ISCORRECT, F_ROUNDFLOAT(15.567, 0.02) FROM RDB$DATABASE;
SELECT 15.57 AS ISCORRECT, F_ROUNDFLOAT(15.567, 0.01) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ROUNDFLOAT(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with ROUND
F_ZAHLRUNDEN
F_ROUNDCOMMON
compatibility FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (ROUND)
Entrypoint zahlrunden compatible with UTF-8
Input DOUBLE
INTEGER
floatingpoint to be round
number of digits to be round
Output DOUBLE floatingpoint rounded (trading method)
Round-to-nearest. Descriped in german standard DIN 1333.
From Wikipedia http://en.wikipedia.org/wiki/Rounding:
This method is commonly used, for example in accounting. It is the one generally taught in basic mathematics classes.
    * Decide which is the last digit to keep.
    * Increase it by 1 if the next digit is 5 or more (this is called rounding up)
    * Leave it the same if the next digit is 4 or less (this is called rounding down)
Examples:
    * 3.044 rounded to hundredths is 3.04 (because the next digit, 4, is less than 5).
    * 3.046 rounded to hundredths is 3.05 (because the next digit, 6, is 5 or more).
    * 3.0447 rounded to hundredths is 3.04 (because the next digit, 4, is less than 5).
Negativ numbers are rounded like their absolute values:
    * −2,1349 to −2,13 €
    * −2,1350 to −2,14 €
TestSQL
SELECT 14.5 AS ISCORRECT, F_ZAHLRUNDEN(14.4935, 1) FROM RDB$DATABASE;
SELECT 14.49 AS ISCORRECT, F_ZAHLRUNDEN(14.4935, 2) FROM RDB$DATABASE;
SELECT 14.494 AS ISCORRECT, F_ZAHLRUNDEN(14.4935, 3) FROM RDB$DATABASE;
SELECT -14.494 AS ISCORRECT, F_ZAHLRUNDEN(-14.4935, 3) FROM RDB$DATABASE;
SELECT 14.494 AS ISCORRECT, F_ZAHLRUNDEN(14.4936, 3) FROM RDB$DATABASE;
SELECT 14.4935 AS ISCORRECT, F_ZAHLRUNDEN(14.4935, 6) FROM RDB$DATABASE;
SELECT 40.43 AS ISCORRECT, F_ZAHLRUNDEN(40.425, 2) FROM RDB$DATABASE;
SELECT 40.42 AS ISCORRECT, F_ZAHLRUNDEN(40.4242, 2) FROM RDB$DATABASE;
SELECT 40.42 AS ISCORRECT, F_ZAHLRUNDEN(40.4246, 2) FROM RDB$DATABASE;
SELECT 75.15 AS ISCORRECT, F_ZAHLRUNDEN(395.50 * (19.00 / 100),2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ZAHLRUNDEN(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ROUNDTOEVEN function from adhoc
Entrypoint roundtoeven compatible with UTF-8
Input DOUBLE
INTEGER
floatingpoint to be round
number of digits to be round
Output DOUBLE floatingpoint rounded (round to even method)
Round to even or bankers' rounding. Descripted in IEEE-754-Standard for calculationg with binary floating-point numbers in computers.
From Wikipedia http://en.wikipedia.org/wiki/Rounding:
This method is also known as statistician's rounding or as bankers' rounding. It is identical to the common method of rounding except when the digit(s) following the rounding digit start with a five and have no non-zero digits after it. The new algorithm is:
    * Decide which is the last digit to keep.
    * Increase it by 1 if the next digit is 6 or more, or a 5 followed by one or more non-zero digits.
    * Leave it the same if the next digit is 4 or less
    * Otherwise, all that follows the last digit is a 5 and possibly trailing zeroes; then change the last digit to the nearest even digit. That is, increase the rounded digit if it is currently odd; leave it if it is already even.
With all rounding schemes there are two possible outcomes: increasing the rounding digit by one or leaving it alone. With traditional rounding, if the number has a value less than the half-way mark between the possible outcomes, it is rounded down; if the number has a value exactly half-way or greater than half-way between the possible outcomes, it is rounded up. The round-to-even method is the same except that numbers exactly half-way between the possible outcomes are sometimes rounded up—sometimes down.
Although it is customary to round the number 4.5 up to 5, in fact 4.5 is no nearer to 5 than it is to 4 (it is 0.5 away from either). When dealing with large sets of scientific or statistical data, where trends are important, traditional rounding on average biases the data upwards slightly. Over a large set of data, or when many subsequent rounding operations are performed as in digital signal processing, the round-to-even rule tends to reduce the total rounding error, with (on average) an equal portion of numbers rounding up as rounding down. This generally reduces the upwards skewing of the result.
Round-to-even is used rather than round-to-odd as the latter rule would prevent rounding to a result of zero.
Examples:
    * 3.016 rounded to hundredths is 3.02 (because the next digit (6) is 6 or more)
    * 3.013 rounded to hundredths is 3.01 (because the next digit (3) is 4 or less)
    * 3.015 rounded to hundredths is 3.02 (because the next digit is 5, and the hundredths digit (1) is odd)
    * 3.045 rounded to hundredths is 3.04 (because the next digit is 5, and the hundredths digit (4) is even)
    * 3.04501 rounded to hundredths is 3.05 (because the next digit is 5, but it is followed by non-zero digits)
Negativ numbers are rounded like their absolute values:
    * −2,35 rounded to tenths is −2,4
    * −2,45 (exact) rounded to tenths is −2,4
    * −2,4500001 rounded to tenths is −2,5
    * −2,46 rounded to tenths is −2,5
    * −2,449 rounded to tenths is −2,4
TestSQL
SELECT 21.14 AS ISCORRECT, F_ROUNDTOEVEN(21.145, 2) FROM RDB$DATABASE
SELECT 215.14 AS ISCORRECT, F_ROUNDTOEVEN(215.145, 2) FROM RDB$DATABASE
SELECT 215.16 AS ISCORRECT, F_ROUNDTOEVEN(215.155, 2) FROM RDB$DATABASE
SELECT 3.02 AS ISCORRECT, F_ROUNDTOEVEN(3.016, 2) FROM RDB$DATABASE;
SELECT 3.01 AS ISCORRECT, F_ROUNDTOEVEN(3.013, 2) FROM RDB$DATABASE;
SELECT 3.02 AS ISCORRECT, F_ROUNDTOEVEN(3.015, 2) FROM RDB$DATABASE;
SELECT 3.04 AS ISCORRECT, F_ROUNDTOEVEN(3.045, 2) FROM RDB$DATABASE;
SELECT 3.05 AS ISCORRECT, F_ROUNDTOEVEN(3.04501, 2) FROM RDB$DATABASE;
SELECT -2.4 AS ISCORRECT, F_ROUNDTOEVEN(-2.35, 1) FROM RDB$DATABASE;
SELECT -2.4 AS ISCORRECT, F_ROUNDTOEVEN(-2.45, 1) FROM RDB$DATABASE;
SELECT -2.5 AS ISCORRECT, F_ROUNDTOEVEN(-2.4500001, 1) FROM RDB$DATABASE;
SELECT -2.4 AS ISCORRECT, F_ROUNDTOEVEN(-2.449, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ROUNDTOEVEN(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_SOFTROUND input/output-compatibility to rFunc (SOFTROUND)
Entrypoint softround compatible with UTF-8
Input DOUBLE
INTEGER
floatingpoint to be round
number of digits to be round
Output INTEGER floatingpoint rounded to integer
The method of rounding is similar to F_ZAHLRUNDEN.
If the result of rounding would be 0, than the result is the non-rounded value.
TestSQL
SELECT 0.0016 AS ISCORRECT, F_SOFTROUND(0.0016, 2), F_ZAHLRUNDEN(0.0016, 2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SOFTROUND(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_RAPPENRUNDUNG function from adhoc
Entrypoint softround compatible with UTF-8
Input DOUBLE floatingpoint to be round
Output INTEGER floatingpoint rounded as rule Rappenrundung
Own translation from Wikipedia http://de.wikipedia.org/wiki/Rundung#Rappenrundung
A special form of rounding in Switzerland is the so called Rappenrundung. In Switzerland people allways count with Rappen (the smaller denomination of a swiss franc, a hundredth of a franc) but amounts of less than 5 Rappen where not paid or bring to account. By this the amounts have to been rounded. The commercial procedure is as follows:
Importend for the way of rounding is the middle between 0 and 5 Rappen (or between 5 and 10 Rappen). If the value is greater or equal to the middle, you must round up, otherwise round down.
TestSQL
SELECT '1.00' AS ISCORRECT, F_RAPPENRUNDUNG(1.000) FROM RDB$DATABASE;
SELECT '1.00' AS ISCORRECT, F_RAPPENRUNDUNG(1.024) FROM RDB$DATABASE;
SELECT '1.05' AS ISCORRECT, F_RAPPENRUNDUNG(1.025) FROM RDB$DATABASE;
SELECT '1.05' AS ISCORRECT, F_RAPPENRUNDUNG(1.074) FROM RDB$DATABASE;
SELECT '1.10' AS ISCORRECT, F_RAPPENRUNDUNG(1.075) FROM RDB$DATABASE;
SELECT '1.10' AS ISCORRECT, F_RAPPENRUNDUNG(1.099) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_RAPPENRUNDUNG(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FIXEDPOINT compatibility FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
Entrypoint fixedpoint compatible with UTF-8
Input DOUBLE
INTEGER
floatingpoint to be round
number of digits to be round
Output CSTRING(32) floatingpoint as a string
The method of rounding is round to even like F_ROUNDTOEVEN.
In difference to F_ZAHLRUNDEN the output is a String!
In string-expenditure the decimal-separator is a "."
TestSQL
SELECT '12345.5' AS ISCORRECT, F_FIXEDPOINT(12345.46, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIXEDPOINT(NULL, NULL) FROM RDB$DATABASE;   
nach oben • go top •
F_FIXEDPOINTLANG function from adhoc
Entrypoint fixedpointlang compatible with UTF-8
Input DOUBLE
INTEGER
CSTRING(1)
CSTRING(1)
floatingpoint to be round
number of digits to be round
Indicator of decimal-separation
Indicator of thousands seperator
Output CSTRING(32) floatingpoint as a string with defined decimal- and thousands separation
The method of rounding is the common method like F_ZAHLRUNDEN.
TestSQL
SELECT '12.345,5' AS ISCORRECT, F_FIXEDPOINTLANG(12345.46, 1, ',', '.') FROM RDB$DATABASE;
SELECT '12.345' AS ISCORRECT, F_FIXEDPOINTLANG(12345.46, 0, ',', '.') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FIXEDPOINTLANG(NULL, NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with TRUNC
F_TRUNCATE compatibility FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
Entrypoint f_truncate compatible with UTF-8
Input DOUBLE floatingpoint to be truncat
Output INTEGER integer
TestSQL
SELECT 15 AS ISCORRECT, F_TRUNCATE(15.567) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_TRUNCATE(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DOLLARVAL
F_CONVERTTODOLLAR
compatibility FreeUDFLib, FreeUDFLib AvERP
compatibility FreeUDFLibC
Entrypoint converttodollar compatible with UTF-8
Input DOUBLE floatingpoint
Output CSTRING(32) Dollar-floatingpoint ($ in front of the number) (rounded to 2 digits)
TestSQL
SELECT '$15.68' AS ISCORRECT, F_CONVERTTODOLLAR(15.678) FROM RDB$DATABASE;
SELECT '$15.68' AS ISCORRECT, F_DOLLARVAL(15.678) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DOLLARVAL(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EUROVAL function from adhoc
Entrypoint euroval not compatible with UTF-8 - use U_INPUTVAL
Input DOUBLE floatingpoint
Output CSTRING(32) EURO-floatingpoint (EUR after the number) (rounded to 2 digits)
TestSQL
SELECT '15.47 EUR' AS ISCORRECT, F_EUROVAL(15.47) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EUROVAL(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_INPUTVAL function from adhoc
Entrypoint euroval compatible with UTF-8
Input DOUBLE floatingpoint
Input CSTRING(10) currency sign
Output CSTRING(32) floatingpoint (currency sign after the number) (rounded to 2 digits)
TestSQL
SELECT '15.42 €' AS ISCORRECT, F_INPUTVAL(15.4249, '€') FROM RDB$DATABASE
SELECT NULL AS ISCORRECT, F_INPUTVAL(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_NUMINWORDS function from adhoc
Entrypoint numinwords not (yet) compatible with UTF-8
Input DOUBLE floatingpoint

SMALLINT number of floatingpoint-digits (no rounding)

CSTRING(2) language identifier for the output
Output CSTRING(32) floatingpoint in words in chosen language
Language identifier: de = German, uk = English, fr = French, es = Spanish, it =Italian, es = Spanish, pt = Portuguese,
nl = Dutch, no = Norwegian, Bokmål, se = Swedish, dk = Danish, fi = Finnish, hu = Hungarian, ie = Irish(Gaelic),
ee = Estonian, is = Icelandic, al = Albanian, va = Classical Latin, v1 = Ecclesiastical Latin, c1 = Catalan, s1 = Scots,
s2 = Scottish Gaelic, w1 = Welsh, b1 = Breton, b2 = Basque, n1 = Norwegian, Nynorsk, za = Afrikaans, fo = Faroese,
lu = Luxembourgish, w2 = Wallon
TestSQL
SELECT '***eins-vier-fünf***' AS ISCORRECT, F_NUMINWORDS(145, 0, 'de') FROM RDB$DATABASE;
SELECT '***eins-vier-fünf-Komma-drei-zwei***' AS ISCORRECT, F_NUMINWORDS(145.32, 2, 'de') FROM RDB$DATABASE;
SELECT '***eins-vier-fünf-Komma-drei-zwei-null-null***' AS ISCORRECT, F_NUMINWORDS(145.32, 4, 'de') FROM RDB$DATABASE;
SELECT '***one-four-five-point-three-two***' AS ISCORRECT, F_NUMINWORDS(145.32, 2, 'uk') FROM RDB$DATABASE;
SELECT '***un-quatre-cinq-virgule-trois-deux***' AS ISCORRECT, F_NUMINWORDS(145.32, 2, 'fr') FROM RDB$DATABASE;
SELECT '***uno-cuatro-cinco-coma-tres-dos***' AS ISCORRECT, F_NUMINWORDS(145.32, 2, 'es') FROM RDB$DATABASE;
SELECT '***uno-quattro-cinque-virgola-tre-due***' AS ISCORRECT, F_NUMINWORDS(145.32, 2, 'it') FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_NUMINWORDS(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Numeric-functions: Calculate
from substitutable with ABS
F_DOUBLEABS
F_ABS
compatibility to FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP
compatibility to GrUDF
compatibility to ib_udf
(ABS)
input/output-compatibility to rFunc (ABS)
Entrypoint doubleabs compatible with UTF-8
Input DOUBLE floatingpoint
Output DOUBLE absolute (positiv) value of a  floatingpoint
TestSQL
SELECT 15.678 AS ISCORRECT, F_DOUBLEABS(15.678) FROM RDB$DATABASE;
SELECT 15.678 AS ISCORRECT, F_DOUBLEABS(-15.678) FROM RDB$DATABASE;
SELECT 15.678 AS ISCORRECT, F_ABS(15.678) FROM RDB$DATABASE;
SELECT 15.678 AS ISCORRECT, F_ABS(-15.678) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ABS(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with ABS
F_INTEGERABS compatibility FreeUDFLibC
Entrypoint integerabs compatible with UTF-8
Input INTEGER integer
Output INTEGER absolute (positiv) value of an integer
TestSQL
SELECT 15 AS ISCORRECT, F_INTEGERABS(15) FROM RDB$DATABASE;
SELECT 15 AS ISCORRECT, F_INTEGERABS(-15) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_INTEGERABS(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with POWER
F_POWER input/output-compatibility to fbudf (POWER)
input/output-compatibility to rFunc ( POWER)
Entrypoint f_power compatible with UTF-8
Input DOUBLE
number to square

DOUBLE exponent
Output DOUBLE suqare number from parameter 1 exponent parameter 2
TestSQL
SELECT 8.0 AS ISCORRECT, F_POWER(2, 3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_POWER(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with EXP
F_EXP compatibility to GrUDF
input/output-compatibility to rFunc ( EXP)
Entrypoint f_exp compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE e exponent  floatingpoint
TestSQL
SELECT 7.38905609893065 AS ISCORRECT, F_EXP(2), F_POWER(F_EULER(), 2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EXP(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with SQRT
F_SQRT input/output-compatibility to udflib, ib_udf
input/output-compatibility to rFunc ( SQRT)
Entrypoint f_sqrt compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE squareroot of  floatingpoint
TestSQL
SELECT 3 AS ISCORRECT, F_SQRT(9) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SQRT(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FACT
F_FACTORIAL
function from adhoc
compatibility to GrUDF
Entrypoint fact compatible with UTF-8
Input INTEGER integer
Output DOUBLE factorial (the product of all natural numbers from 1 to parameter 1)
TestSQL
SELECT 6.000 AS ISCORRECT, F_FACT(3) FROM RDB$DATABASE;
SELECT 6.000 AS ISCORRECT, F_FACTORIAL(3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FACT(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with MODULO
F_MODULO compatibility FreeUDFLib, FreeUDFLibC, FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (MOD)
Entrypoint f_modulo compatible with UTF-8
Input INTEGER
INTEGER
divident (the number, which will be divided)
divisor (the number, by which one divides)
Output INTEGER Modulo (Rest of division of two integers) from parameter 1 divided through parameter 2
TestSQL
SELECT 2 AS ISCORRECT, F_MODULO(5, 3) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_MODULO(6, 3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MODULO(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_REMAINDER function from adhoc
Entrypoint f_remainder
UTF-8 kompatibel
Input DOUBLE
DOUBLE
divident (the number, which will be divided)
divisor (the number, by which one divides)
Output DOUBLE
Rest of division of two numbers, parameter 1 divided through parameter 2
TestSQL
SELECT CAST(3 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(15, 6) FROM RDB$DATABASE;
SELECT CAST(0 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(15, 5) FROM RDB$DATABASE;
SELECT CAST(-1 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(15, 4) FROM RDB$DATABASE;
SELECT CAST(-0.4 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(11.6, 2) FROM RDB$DATABASE;
SELECT CAST(-1 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(11.6, 2.1) FROM RDB$DATABASE;
SELECT CAST(-3 AS DOUBLE PRECISION) AS ISCORRECT, F_REMAINDER(-15, 4) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_REMAINDER(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DIV input/output-compatibility to rFunc (DIV)
Entrypoint f_div compatible with UTF-8
Input INTEGER
INTEGER
divident (the number, which will divided)
divisor (the number, by which one divides)
Output INTEGER integer part from parameter 1 divided through parameter 2
TestSQL
SELECT 1 AS ISCORRECT, F_DIV(5, 3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_DIV(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with FLOOR
F_FLOOR input/output-compatibility to ib_udf
input/output-compatibility to rFunc (FLOOR)
Entrypoint f_floor compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE the largest integer less than or equal to input as a floatingpoint
Note differences from F_FLOOR, F_CEILING and F_TRUNCATE
TestSQL
SELECT 3.0 AS ISCORRECT, F_FLOOR(3.85), F_CEILING(3.85),F_TRUNCATE(3.85) FROM RDB$DATABASE;
SELECT -4.0 AS ISCORRECT, F_FLOOR(-3.85), F_CEILING(-3.85),F_TRUNCATE(-3.85) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FLOOR(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with CEILING
F_CEILING input/output-compatibility to ib_udf
input/output-compatibility to rFunc (CEIL)
Entrypoint f_ceiling compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE the smallest integer greater than or equal to input as a floatingpoint
Note differences from F_FLOOR, F_CEILING and F_TRUNCATE
TestSQL
look F_FLOOR
SELECT NULL AS ISCORRECT, F_CEILING(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_FRAC input/output-compatibility to ib_udf
Entrypoint f_frac compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE the digits after the decimal-seperator of a  floatingpoint
TestSQL
SELECT 0.12345 AS ISCORRECT, F_FRAC(15.12345) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_FRAC(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with LN
F_LN input/output-compatibility to ib_udf
input/output-compatibility to rFunc (LN)
Entrypoint f_ln compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE natural logarithmn (logarithmn to basis e) of the input
TestSQL
SELECT 0.693147180559945 AS ISCORRECT, F_LN(2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LN(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with LOG
F_LOG input/output-compatibility to ib_udf
input/output-compatibility to rFunc (LOG)
Entrypoint f_log compatible with UTF-8
Input DOUBLE
floatingpoint

DOUBLE basis for logarithmn
Output DOUBLE logarithmn of floatingpoint with basis of parameter 2
TestSQL
SELECT 0.301029995663981 AS ISCORRECT, F_LOG(2, 10), F_LOG10(2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LOG(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with LOG10
F_LOG10 input/output-compatibility to ib_udf
input/output-compatibility to rFunc (LOG10)
Entrypoint f_log10 compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE logarithmus of  floatingpoint with basis 10
TestSQL
SELECT 0.301029995663981 AS ISCORRECT, F_LOG10(2) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_LOG10(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_ISDIVISIBLEBY compatibility FreeUDFLib, FreeUDFLib AvERP
Entrypoint isdivisibleby compatible with UTF-8
Input INTEGER
INTEGER
divident (the number, which will divided)
divisor (the number, by which one divides)
Output INTEGER 1 = is divisibly through, 0 = is not divisibly through
TestSQL
SELECT 1 AS ISCORRECT, F_ISDIVISIBLEBY(15, 3) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_ISDIVISIBLEBY(15, 4) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_ISDIVISIBLEBY(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EVEN function from adhoc
Entrypoint evenodd compatible with UTF-8
Input INTEGER integer
Output INTEGER 1 = is even, 0 = is odd
If a floatingpoint is used as input, it will be truncated first to integer and than tested!
TestSQL
SELECT 1 AS ISCORRECT, F_EVEN(2) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EVEN(3) FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_EVEN(0) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EVEN(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with SIGN
F_SIGN input/output-compatibility to ib_udf
input/output-compatibility to rFunc (SIGN)
Entrypoint f_sign compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE sign of  floatingpoint 1 = positiv, 0 = 0, -1 = negativ
TestSQL
SELECT 1 AS ISCORRECT, F_SIGN(3) FROM RDB$DATABASE;
SELECT -1 AS ISCORRECT, F_SIGN(-3) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_SIGN(0) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SIGN(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_PROZENTE compatibility FreeUDFLib AvERP, GrUDF
Entrypoint prozente compatible with UTF-8
Input DOUBLE
DOUBLE
floatingpoint 1, e. g. sales price
floatingpoint 2, e. g. purchase price
Output DOUBLE who many margin % between param 2 and param 1
Calculate the margin % between 2 values, i. e. margin between purchase price and sales price with formula: (( 100 / param 2 ) * param 1 ) - 100
Test-SQL
SELECT 50.000 AS ISCORRECT, F_PROZENTE(21.00, 14.0) FROM RDB$DATABASE;
SELECT 10.000 AS ISCORRECT, F_PROZENTE(15.40, 14.0) FROM RDB$DATABASE;

SELECT NULL AS ISCORRECT, F_PROZENTE(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_Z input/output-compatibility to rFunc (Z)
Entrypoint r_z compatible with UTF-8
Input DOUBLE
floatingpoint
Output DOUBLE if Input <null> Output 0 otherwise Input
Output RETURN mechanism BY VALUE
Test-SQL
SELECT 14.000 AS ISCORRECT, F_Z(14.0) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_Z(NULL) FROM RDB$DATABASE;
nach oben • go top •
F_DZERO input/output-compatibility to rFunc (DZERO)
Entrypoint r_dzero compatible with UTF-8
Input DOUBLE
DOUBLE
DOUBLE
divident (the number, which will divided)
divisor (the number, by which one divides)
value of divisor if divisor = 0
Output DOUBLE if divisor = 0 output parameter 3 otherwise division paramter 1 / parameter 2
Output RETURN mechanism BY VALUE
Test-SQL
SELECT 14.000 AS ISCORRECT, F_DZERO(15.5, 0.0, 14.0) FROM RDB$DATABASE;
nach oben • go top •
 
Numeric-functions: Compare
from substitutable with MAXVALUE
F_MAXNUM
 
F_MAX
function from adhoc
input/output-compatibility to rFunc (MAXNUM)
compatibility to GrUDF
Entrypoint maxnum compatible with UTF-8
Input DOUBLE
DOUBLE
floatingpoint 1
floatingpoint 2
Output DOUBLE the max. of the two  floatingpoins
TestSQL
SELECT 15.346 AS ISCORRECT, F_MAXNUM(15.345, 15.346) FROM RDB$DATABASE;
SELECT 15.346 AS ISCORRECT, F_MAX(15.345, 15.346) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MAX(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with MINVALUE
F_MINNUM
 
F_MIN
function from adhoc
input/output-compatibility to rFunc (MINNUM)
compatibility GrUDF
Entrypoint minnum compatible with UTF-8
Input DOUBLE
DOUBLE
floatingpoint 1
floatingpoint 2
Output DOUBLE the min. of the two  floatingpoins
TestSQL
SELECT 15.345 AS ISCORRECT, F_MINNUM(15.345, 15.346) FROM RDB$DATABASE;
SELECT 15.345 AS ISCORRECT, F_MIN(15.345, 15.346) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_MIN(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EQUALINTEGER compatibility FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (IEQUAL)
Entrypoint equalinteger compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER 1 =is equal, 0 = is not equal
If a floatingpoint is used as input, it will be truncated first to integer and than tested!
TestSQL
SELECT 1 AS ISCORRECT, F_EQUALINTEGER(14, 14) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EQUALINTEGER(14, 15) FROM RDB$DATABASE;
SELECT 1 AS ISCORRECT, F_EQUALINTEGER(14, 14.49) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EQUALINTEGER(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_EQUALFLOAT compatibility zu FreeUDFLib AvERP, GrUDF
input/output-compatibility to rFunc (DEQUAL)
Entrypoint equalfloat compatible with UTF-8
Input DOUBLE
DOUBLE
floatingpoint 1
floatingpoint 2
Output INTEGER 1 = is equal, 0 = is not equal
TestSQL
SELECT 1 AS ISCORRECT, F_EQUALFLOAT(14.00, 14.0) FROM RDB$DATABASE;
SELECT 0 AS ISCORRECT, F_EQUALFLOAT(14.00, 14.01) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_EQUALFLOAT(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Numeric-functions: Binary functions
from substitutable with BIN_AND
F_BIN_AND input/output-compatibility to ib_udf
input/output-compatibility to rFunc (BINAND)
Entrypoint f_bin_and compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER binary AND of the two integers
TestSQL
SELECT 1 AS ISCORRECT, F_BIN_AND(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_AND(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with BIN_OR
F_BIN_OR input/output-compatibility to ib_udf
input/output-compatibility to rFunc (BINOR)
Entrypoint f_bin_or compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER binary OR  of the two integers
TestSQL
SELECT 7 AS ISCORRECT, F_BIN_OR(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_OR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with BIN_XOR
F_BIN_XOR input/output-compatibility to ib_udf
input/output-compatibility to rFunc (BINXOR)
Entrypoint f_bin_xor compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER binary exclusive OR of the two integers
TestSQL
SELECT 6 AS ISCORRECT, F_BIN_XOR(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_XOR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_BIN_NOT input/output-compatibility to ib_udf
input/output-compatibility to rFunc (BINNOT)
Entrypoint f_bin_not compatible with UTF-8
Input INTEGER integer 
Output INTEGER binary NOT of integer
TestSQL
SELECT -4 AS ISCORRECT, F_BIN_NOT(3) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_NOT(NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with BIN_SHL
F_BIN_SHL input/output-compatibility to ib_udf, GrUDF
Entrypoint f_bin_shl compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER binary SHIFT left
TestSQL
SELECT 96 AS ISCORRECT, F_BIN_SHL(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_SHL(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
from substitutable with BIN_SHR
F_BIN_SHR input/output-compatibility to ib_udf, GrUDF
Entrypoint f_bin_shr compatible with UTF-8
Input INTEGER
INTEGER
integer 1
integer 2
Output INTEGER binary SHIFT right
TestSQL
SELECT 0 AS ISCORRECT, F_BIN_SHR(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_SHR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_BIN_GET input/output-compatibility to rFunc (GETBIT)
Entrypoint r_getbit compatible with UTF-8
Input INTEGER
INTEGER
integer
No. of Bit looked for
Output INTEGER parameter 2 Bit of integer
TestSQL
SELECT 0 AS ISCORRECT, F_BIN_GET(3, 5) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_SHR(NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
F_BIN_SET input/output-compatibility to rFunc (SETBIT)
Entrypoint r_setbit compatible with UTF-8
Input INTEGER
INTEGER
INTEGER
integer
No. of  Bit to replace
Bit to set
Output INTEGER integer returned when Bit of parmeter 2 was replaced with Bit of parameter 3
TestSQL
SELECT 1 AS ISCORRECT, F_BIN_GET(F_BIN_SET(3, 5, 1), 5) FROM RDB$DATABASE;
SELECT 35 AS ISCORRECT, F_BIN_SET(3, 5, 1) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_BIN_SHR(NULL, NULL, NULL) FROM RDB$DATABASE;
nach oben • go top •
 
Numeric-functions: Trigonometry

input/output-compatibility to ib_udf
input/output-compatibility to rFunc
Input ever DOUBLE ... in radian
Output ever DOUBLE ... in radian
from substitutable with SIN
F_SIN counts Sinus
Entrypoint sin_rad compatible with UTF-8
from substitutable with COS
F_COS counts Cosinus
Entrypoint cos_rad compatible with UTF-8
from substitutable with TAN
F_TAN counts Tangens
Entrypoint tan_rad compatible with UTF-8
from substitutable with COT
F_COT counts Cotangens
Entrypoint cot_rad compatible with UTF-8
from substitutable with ASIN
F_ASIN counts ArcSinus
Entrypoint arcsin_rad compatible with UTF-8
from substitutable with ACOS
F_ACOS counts ArcCosinus
Entrypoint arccos_rad compatible with UTF-8
from substitutable with ATAN
F_ATAN counts ArcTangens
Entrypoint arctan_rad compatible with UTF-8
F_ATAN2 counts ArcTangens x / y
Entrypoint arctan2_rad compatible with UTF-8
F_ACOT counts ArcCotangens
Entrypoint arccot_rad compatible with UTF-8


function from adhoc
Input ever DOUBLE ... in degree
Output ever DOUBLE ... in degree
F_SIND
counts Sinus
Entrypoint sin_deg compatible with UTF-8
F_COSD counts Cosinus
Entrypoint cos_deg compatible with UTF-8
F_TAND counts Tangens
Entrypoint tan_deg compatible with UTF-8
F_COTD counts Cotangens
Entrypoint cor_deg compatible with UTF-8
F_ARCSIND counts ArcSinus
Entrypoint arcsind_deg compatible with UTF-8
F_ARCCOSD counts ArcCosinus
Entrypoint arccos_deg compatible with UTF-8
F_ARCTAND counts ArcTangens
Entrypoint arctan_deg compatible with UTF-8
F_ARCCOTD counts ArcCotangens
Entrypoint arccot_deg compatible with UTF-8


input/output-compatibility to ib_udf
input/output-compatibility to rFunc
Input ever DOUBLE
Output ever DOUBLE
from substitutable with SINH
F_SINH counts SinusHyperbolicus
Entrypoint sinhyp compatible with UTF-8
from substitutable with COSH
F_COSH counts CosinusHyperbolicus
Entrypoint coshyp compatible with UTF-8
from substitutable with TANH
F_TANH counts TangensHyperbolicus
Entrypoint tanhyp compatible with UTF-8
F_COTH counts CotangensHyperbolicus
Entrypoint cothyp compatible with UTF-8


function from adhoc
F_ARSINH
berechnet den AreaSinusHyperbolicus
Entrypoint arcsinh compatible with UTF-8
F_ARCOSH
counts AreaSinusHyperbolicus
Entrypoint arccosh compatible with UTF-8
F_ARTANH
counts AreaTangensHyperbolicus
Entrypoint arctanh compatible with UTF-8
F_ARCOTH counts AreaCotangensHyperbolicus
Entrypoint arccoth compatible with UTF-8
TestSQL
SELECT 1 AS ISCORRECT, F_SIN(1.5707963267949), F_SIN(F_DEGTORAD(90)), F_SIND(90) FROM RDB$DATABASE;
SELECT NULL AS ISCORRECT, F_SIN(NULL) FROM RDB$DATABASE;
vorige Seite • previous page • passée sitenach oben • go top • vers le hautnächste Seite • next page • prochain site