Subject Re: [firebird-support] About arithmetic in Firebird Yang Jin 2005-11-01T11:26:10Z
Can you talk about the different in DOUBLE PRECISION?
Tks.

Ivan Prenosil <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

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

---------------------------------

Visit your group "firebird-support" on the web.

To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com