Subject Re: [firebird-support] About arithmetic in Firebird
Author Ivan Prenosil
>> I want to know how to solution X/Y = Z (like12/8 = 1.5) in store
>> procedure.
>>
>
> Integer/integer division:
>
> 12/8 = 1
> 10/8 = 1
>
> Real number in one operand:
>
> 12.0/8 = 1.5
> 1.00/8 = 1.25
>
> or
>
> 12/8.0 = 1.5
> 10/8.0 = 1.2
> 10/8.00 = 1.25
>
> Real numbers in both operands:
>
> 12.00/8.00 = 1.5000
>
> So, if you have two integers, include a real multiplier:
>
> (X * 1.00)/Y
> or
> X/(Y * 1.00)
>
> It's not just in SPs, it applies to all SQL arithmetic.
>
> ./heLen

Small correction - Helen is talking about NUMERIC/DECIMAL datatype here,
which is something completely different than real number (DOUBLE PRECISION).

Ivan