• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android Studio and Floating Point values.

Is it the case thaqt Android Studio programs, when compiled, build, installed, and run
on Android Smartphones, do experience floating point denormal or pronormal value
inclusion?

For example, what will the following code do, evaluate to true, or false?

double a = 0.1;
double b = 0.1;
double x = a*b;
out.println(x == 0.01);

If the final line produces false, is there a switch for the compiler or runtime that developers
can use to make denormal and pronormal discrepencies simply go away,
for cases that are like this, involving float and double? If so, what is that said switch?
Can someone in the know with all these things kindly reply to me here?
 
The answer, surely, is to round x to 2 decimal places before comparing it with 0.01.
 
This, politely, is not the answer to what I have asked. My question is as to if, in android studio
and android app programming, if the following example will include a pronormal value,
away from 0.01 in the example, which would require rounding at all. In the example
of 0.1*0.1, which is a known situation, is there a present pronormal that happens,
yes or no?
 
Can someone please tell me if the Java coding in Android studio still experiences
arithmetic underflow or overflow, particularly, please?
 
Back
Top Bottom