473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

J2ME: Dealing with Floating Points?

How do you deal with floating points in J2ME? From my understanding
MIDP 1.0 does not allow you to use float or double primitives. I want
to be able to perform a calculations which give float or double
values.

Thanks
Jul 17 '05 #1
2 8304

"gilgantic" <gi*******@yahoo.com> wrote in message
news:d6**************************@posting.google.c om...
How do you deal with floating points in J2ME? From my understanding
MIDP 1.0 does not allow you to use float or double primitives. I want
to be able to perform a calculations which give float or double
values.

Thanks


Hi.

J2ME (CLDC1.0) does not have support for floats/doubles. Do a 'google' on
"fixed point J2ME" and you'll find some free libraries that implement fixed
point numbers. The ones i've found are mainly used for games, where
precision is of a lower priority than speed. I've written (using the
BigDecimal class from J2SE as a basis), for a program that i'm writing, a
library handling fixed point values with arbitray precision for J2ME. It is
very precise but not very fast.

-- Anton.
Jul 17 '05 #2
gilgantic wrote:
How do you deal with floating points in J2ME? From my understanding
MIDP 1.0 does not allow you to use float or double primitives. I want
to be able to perform a calculations which give float or double
values.

Thanks


Yes you are right you cannot use floating point primitives in J2ME. How
ever there is a working around to solve this problem. Try to look at
this url:

http://saloon.javaranch.com/cgi-bin/...&f=41&t=001663

If it does't work please send me an e-mail and I will look at is.

RGDS

Thomas Winterberg

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Oz Mortimer | last post by:
Hi, Is there any way that I can scroll a canvas - i.e. if there are too many items on the canvas you can still access by pressing down. I know Form does this (apparently) but I need to do it...
0
by: Todd Christy | last post by:
I am building a J2ME application for a BlackBerry handheld device. This application connects to an IIS server via HTTP to execute remote ASPX-based services that collect and return data. We are...
0
by: Dave Rathnow | last post by:
We are looking at using J2ME in a embedded device that will be deployed in an industrial application and I've been doing some research to see how practical J2ME would be for our application. Most...
1
by: Sveta | last post by:
Hi, all! I am new with J2ME. I have application that has form with 2 commands (exit and select). All UI uses are high level API, and it is very important to leave it high-level. This...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
32
by: ma740988 | last post by:
template <class T> inline bool isEqual( const T& a, const T& b, const T epsilon = std::numeric_limits<T>::epsilon() ) { const T diff = a - b; return ( diff <= epsilon ) && ( diff >= -epsilon );...
2
by: mayankcdac | last post by:
Hi i am a new guy in j2me field i am working in j2me gaming but i want to switch from gaming to application. i am facing some problems to build j2me application can any one give me any source code(...
0
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.