Arsip: Help me...hasil pembagian firebird aneh.....

 
user image
more 17 years ago

batozai

para master delphi pls help me....:( saya bikin stored procedure di firebird yang untuk melakukan pembagian dua bilangan. kenapa hasil dari procedure tsb tidak sama dengan hasil yang diperoleh dengan coding melalui delphi. berikut adalah contoh procedure saya di firebird. saya menggunakan firebir 2.0.1.2855 CREATE PROCEDURE PDIVISIONTEST ( pinum integer, pidivider integer) returns ( rfdivision float) as begin rfdivision = (pinum + 0.000) / pidivider; end dibawah adalah contoh perbandingan hasil dengan calculator bawaan windows,msexcel, dan dari delphi contoh : 92 / 12 ---> RFDIVISION = 7.66599988937378 ( firebird ) 97 / 16 ----> RFDIVISION = 6.06199979782104 33 / 13 ----> RFDIVISION = 2.53800010681152 92 / 12 ---> 7.66666666666667 (delphi,calculator,ms excel) 97 / 16 ----> 6.0625 33 / 13 ----> 2.53846153846154 Plss....help me, apanya yang salah ? apa procedure di FB nya yang salah ? sudah beberapa hari saya otak atik hasilnya tetap sama, sementara deadline sudah dekat..:( pls....somebody help me :(
user image
more 17 years ago

mas_kofa

coba type rfdivision diganti double precision
user image
more 17 years ago

batozai

Sudah saya coba mas. 92/16 hasilny 7.666. Klo excel jdiny 7.667 saya sudah bkin bnyk procedure dg prhtungan serupa. Bingung bgt nih...help solusiny...kalo boleh tany, mas kofa db engineny biasany pake ap ?
user image
more 17 years ago

batozai

Some body out there pls help me....;-(
user image
more 17 years ago

batozai

Some body out there pls help me....;-(
user image
more 17 years ago

imunk

solusi gimana nih, aku coba juga di mysql hasilnya seperti ini: 92 / 12 ---> 7.6666665077209 (MySQL) 97 / 16 ----> 6.0625 33 / 13 ----> 2.5384614467621 beda juga.... :D
user image
more 17 years ago

batozai

Waah kayake puny mas kofa lebih mendekati deh...:) uhm...apa saya beralih ke mysql aj ya ? Tapi project dah 80% jadi :( Btw...mungkin master2 yang lain ada hasil yg beda dgan db engine lainny ? Hayoo...kita share...
user image
more 17 years ago

batozai

Waah kayake puny mas kofa lebih mendekati deh...:) uhm...apa saya beralih ke mysql aj ya ? Tapi project dah 80% jadi :( Btw...mungkin master2 yang lain ada hasil yg beda dgan db engine lainny ? Hayoo...kita share...
user image
more 17 years ago

batozai

Waah kayake puny mas kofa lebih mendekati deh...:) uhm...apa saya beralih ke mysql aj ya ? Tapi project dah 80% jadi :( Btw...mungkin master2 yang lain ada hasil yg beda dgan db engine lainny ? Hayoo...kita share...
user image
more 17 years ago

pakistan

Dulu pernah baca Artikel, bahwa utk firebird DILARANG keras membagi Integer dg Integer jika hasilnya bukan Integer ...(utk Dialek 3) Jadi Solusinya adalah di Casting ke Float. CREATE PROCEDURE PDIVISIONTEST ( PINUM INTEGER, PIDIVIDER INTEGER) RETURNS ( RFDIVISION FLOAT) AS begin rfdivision = (cast(pinum as float) ) / cast(pidivider as float); end Coba Anda lakukan hasil perhitungan Aneh sbb: select 1/33 from rdb$database atau select (1/3) 3 from rdb$database Hasilnya adalah 0 (NOL) .... Aneh 'kan ???? :D Sekarang coba Anda casting ke FLOAT: select (cast(1 as float)/cast(3 as float))*3 from rdb$database Hasilnya adalah 1,00 ... Firebird memang benar-benar Aneh ...
more ...
  • Pages:
  • 1
  • 2
Share to

AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now: https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com