Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

deleted 53 characters in body
Source Link
Tom Wellbrock
  • 3.1k
  • 1
  • 15
  • 21

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

Also notice that the primitive types can NOT store an indefinitinfinite set of numbers:

float range: from 1.40129846432481707e-45 to 3.40282346638528860e+38
double range: from 1.7e–308 to 1.7e+308

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

Also notice that the primitive types can NOT store an indefinit set of numbers:

float range: from 1.40129846432481707e-45 to 3.40282346638528860e+38
double range: from 1.7e–308 to 1.7e+308

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

Also notice that the primitive types can NOT store an infinite set of numbers:

float range: from 1.40129846432481707e-45 to 3.40282346638528860e+38
double range: from 1.7e–308 to 1.7e+308
added 202 characters in body
Source Link
Tom Wellbrock
  • 3.1k
  • 1
  • 15
  • 21

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

Also notice that the primitive types can NOT store an indefinit set of numbers:

float range: from 1.40129846432481707e-45 to 3.40282346638528860e+38
double range: from 1.7e–308 to 1.7e+308

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

Also notice that the primitive types can NOT store an indefinit set of numbers:

float range: from 1.40129846432481707e-45 to 3.40282346638528860e+38
double range: from 1.7e–308 to 1.7e+308
Source Link
Tom Wellbrock
  • 3.1k
  • 1
  • 15
  • 21

Just cast your double to a float.

double d = getInfoValueNumeric();
float f = (float)d;

there are lot of answeres to this question already

lang-java

AltStyle によって変換されたページ (->オリジナル) /