Subject Re: [ib-support] Re: integer division & casting
Author Mpu Gondrong
Jumat, 31/05/02 0:01:36, csswa menulis:

c> Try it with a pair of divided integers, e.g.
c> result = Par / Par + 1 * 3.1415 + 5.4321 * 5 - 4 / 9 * 4.2456;

Have you tried that first ? I've tried like this:

SQL> show version;
ISQL Version: LI-T1.0.0.796 Firebird 1.0
InterBase/linux Intel (access method), version "LI-T6.2.796 Firebird 1.0"
InterBase/linux Intel (remote server), version "LI-T6.2.796 Firebird 1.0/tcp (sim.gatra.com)/P10"
InterBase/linux Intel (remote interface), version "LI-T1.0.0.368 Firebird Beta2/tcp (sim.gatra.com)/P10"
on disk structure version 10.0
SQL> show sql dialect;
Client SQL dialect is set to: 1 and database SQL dialect is: 1
SQL> show procedure sp_test_2;
Procedure text:
=============================================================================
begin
result = Par / Par + 1 * 3.1415 + 5.4321 * 5 - 4 / 9 * 4.2456;
end
=============================================================================
Parameters:
PAR INPUT INTEGER
RESULT OUTPUT NUMERIC(15, 4)
SQL> execute procedure sp_test_2(9);
RESULT
=======================
29.4151

Tertanda,
Oguds [36856104]