Skip to main content

J2ME Math exp

3 replies [Last post]
Joined: 2008-06-09


I am 18 years old, and started programming in C/C++.
Now I have recently started ME and i need help.

It is very possible that my problem was solved long ago, but I can't find any proper solve.

I want to calculate e^(-x)
This is not the real problem. I have found a site where parts of this problem is solved.

But there is a problem with negativ double value like:

Perhaps I didn't recocnized that how this problem is solved in this article.

So I need help.

Yours seisop
(please tolerate my English ^^)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-05-24

If anyone is finds this thread, I've put up sample code on a related forum for Java ME exp, log, and pow functions ported directly from Sun's own FDLIBM C-library equivalents. These MathUtil functions give exactly the same results as Java SE. If you use them, please acknowledge the source.

Joined: 2004-03-04


With CLDC and MIDP if you want access to math functions you probably want to add a math library to your application. For example:

This or other libraries should give you the computations you want.

-- Terrence

Joined: 2008-06-09

Thanks for your answer.

[i]Provides classes for performing IEEE-754 floating-point arithmetic on JVM implementations which lack native float and double datatypes. This is intended for use on "micro" devices such as mobile phones, which implement the CLDC 1.0 specification. [b]Note that CLDC 1.1 includes native floating-point support, so you don't need this library when running on a CLDC 1.1 JVM[/b].[/i]

I run under MIDP 2.0 and CLCD 1.1.
So I don't know if adding this library can help me further, but I will try.
The normal ME Math library is in my Project, but there are only a few methods from SE edition.

But I will try it anyway.