Subject Re: [firebird-support] About arithmetic in Firebird
Author Yang Jin
Thank for your reply,of course inclued helen's fast response.
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
on the main (top) menu. Try Knowledgebase and FAQ links !

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

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




---------------------------------
YAHOO! GROUPS LINKS


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

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

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


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




---------------------------------
无限容量雅虎相册,原图等大下载,超快速度,赶快抢注!

[Non-text portions of this message have been removed]