error when calling method with a return of double in j2me
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mahmoud_el
Posted On:   Saturday, October 26, 2002 11:21 PM

hello all, i have following problem with a j2me program: if i call a method with a return of double, then i get following error message: ERROR: floating-point constants should not appear Error preverifying class test.hallo what i'm doing wrong thanks in regard ----------------example---------------------------- double yourValue(int y, int m, int d) {   double v = 0.10;   v = 3.39 *y* m *d   return v; }  public void startApp() {   int td;   int y =2;   int m =2;   int d =2;    More>>

hello all,

i have following problem with a j2me program:
if i call a method with a return of double, then i get following error
message:
ERROR: floating-point constants should not appear
Error preverifying class test.hallo
what i'm doing wrong
thanks in regard



----------------example----------------------------


double yourValue(int y, int m, int d)

{

  double v = 0.10;

  v = 3.39 *y* m *d



  return v;

}





 public void startApp()

{

  int td;

  int y =2;

  int m =2;

  int d =2;



  td = yourValue(y,m,d);



  return(td);

}


   <<Less

Re: error when calling method with a return of double in j2me

Posted By:   James_McLachlan  
Posted On:   Sunday, October 27, 2002 08:12 AM

Just as the preverifier has pointed out, there is no floating point (float or double) support in J2ME.

If you really need support of this type, you should have a look for a third party library. The only one I found last time I looked was for fixed point support. (I posted the web link on this site a few weeks ago.

Jim.

About | Sitemap | Contact