# J2ME Math exp

Hello,

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.

http://today.java.net/pub/a/today/2007/11/06/creating-java-me-math-pow-m...

But there is a problem with negativ double value like:

e^(-3.2)

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

So I need help.

Yours seisop

(please tolerate my English ^^)

seisop,

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

http://www.dclausen.net/projects/microfloat/

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

-- Terrence

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.

seisop

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.

http://forums.java.net/jive/thread.jspa?messageID=341742񓛮