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

Return to Revisions

3 of 3
deleted 53 characters in body
Tom Wellbrock
  • 3.1k
  • 1
  • 15
  • 21

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
Tom Wellbrock
  • 3.1k
  • 1
  • 15
  • 21

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