-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
reza_elkaOffline
Location:
22 Post subject: Cara mengatasi error "INVALID FLOATING POINT OPERATION&  PostPosted: 19/Jul/2011 16:16
onIntermediate


Joined: 12-Jun-2008
Posts: 46

Status: Offline
Para master semua, sy minta tolong bagaimana cara mengatasi error "INVALID FLOATING POINT OPERATION".

ini penggalan source code nya.

      Code:
 function dmc(var temp,RH,Rain,dmcprev,lat,month : real) : real ;
var
   re, Mo, Mr, K, B, P, Pr, Dl : real;
begin
   if rain > 1.5 then
   begin
      re := (0.92 * rain) - 1.27;
      
      //hitung mo
      mo := 20 + exp(5.6348 - dmcprev / 43.43);
      
      // hitung b
      if dmcprev <= 33 then
         b := 100 / (0.5 + 0.3 * dmcprev)
      else
      if dmcprev > 65 then
         b := 14 - 1.3 * ln(dmcprev)
      else
         b := (6.2 * ln(dmcprev)) - 17.2;
   end;
   
   // hitung mr
   mr := mo + ((1000 * re) / (48.77 + b * re));
   
   // hitung pr
   pr := 244.72 - (43.3 * ln(mr-20));
   if pr < 0 then
      pr := 0
   else
  if pr > 0 then
      pr := dmcprev;
   
   // hitung k
   if temp > -1.1 then
   begin
      case round(month) of
    1 : dl := 6.5;
    2 : dl := 76.5;
    3 : dl := 9;
    4 : dl := 12.8;
    5 : dl := 13.9;
    6 : dl := 13.9;
    7 : dl := 12.4;
    8 : dl := 10.9;
    9 : dl := 9.4;
    10 : dl := 8;
    11 : dl := 7;
    12 : dl := 6;
    end;
      k := 1.894 * (temp+1.1) * (100-RH) * dl * 0.000001;
   end
   else
      k := 0;
   
   dmc := dmcprev + 100*k;
end;



Jika di-compile dan dipanggil, akan berhenti pada perhitungan pr.

      Code:
pr := 244.72 - (43.3 * ln(mr-20));


Tolong ya....
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
reza_elkaOffline
Location:
Post subject:   PostPosted: 19/Jul/2011 16:23
onIntermediate


Joined: 12-Jun-2008
Posts: 46

Status: Offline
Maaf, gambar pesan error-nya lupa. ini sy upload lagi



Makasih ya...
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
DelphiExpert
Location:
Post subject:   PostPosted: 20/Jul/2011 13:15
onMage


Joined: 06-Feb-2006
Posts: 2401

Coba type datanya diganti, dari Real menjadi Double (kali aja overflow).

_________________
Dude, if you don't understand the basics and just want to get someone else write the code for you, it means you really shouldn't study computer science. Find a different field.
http://delphiexpert.wordpress.com
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
mat_koderOffline
Location:
Post subject:   PostPosted: 20/Jul/2011 14:52
onUber-Skilled


Joined: 16-Jan-2006
Posts: 344

Status: Offline
pastikan mr harus > 20.0 , spy argumen logaritma tidak negatip.

_________________
..... good enough is not enough........
 
 View user's profile Send private message  
Reply with quote Back to top
reza_elkaOffline
Location:
Post subject:   PostPosted: 20/Jul/2011 16:54
onIntermediate


Joined: 12-Jun-2008
Posts: 46

Status: Offline
Terima kasih buat DelphiExpert dan MatKoder atas bantuannya.

Setelah sy coba-coba, dan memasukan nilai variabel yg berbeda2, sy menemukan solusinya. Ternyata jika RAIN > 1.5 tidak ada pesan error dan jika dimasukan nilai RAIN <= 1.5 maka pesan error akan keluar. Dari kasus tsb listing tsb sedikit dirubah

semulanya :
      Code:
if rain > 1.5 then
   begin
      re := (0.92 * rain) - 1.27;
     
      //hitung mo
      mo := 20 + exp(5.6348 - dmcprev / 43.43);
     
      // hitung b
      if dmcprev <= 33 then
         b := 100 / (0.5 + 0.3 * dmcprev)
      else
      if dmcprev > 65 then
         b := 14 - 1.3 * ln(dmcprev)
      else
         b := (6.2 * ln(dmcprev)) - 17.2;
   end;


Diubah menjadi :
      Code:
if rain <= 1.5 then
   re := rain
else
if rain > 1.5 then
   re := (0.92 * rain) - 1.27;

//hitung mo
mo := 20 + exp(5.6348 - dmcprev / 43.43);

// hitung b
if dmcprev <= 33 then
   b := 100 / (0.5 + 0.3 * dmcprev)
else
if dmcprev > 65 then
   b := 14 - 1.3 * ln(dmcprev)
else
   b := (6.2 * ln(dmcprev)) - 17.2;


Pada proses perhitungan pr, awalnya tidak menemukan nilai dari mr, karena masih dalam satu perintah if rain > 1.5. jika RAIN dimasukan nilai 0 (<1.5), maka nilai mr tidak akan ada, karena mr akan dihitung hanya pada jika RAIN > 0.

Sekali lagi Terima Kasih ya
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |