Can a Java Long type be a fraction? -
can java long type fraction?
long longvalue = 0.2; i've tried google , found minimum , maximum values couldn't determine whether included fractional or whole values.
static long max_valuea constant holding maximum value long can have, 263-1.
static long min_valuea constant holding minimum value long can have, -263.
according definition of long http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
long: long data type 64-bit two's complement integer. signed long has minimum value of -263 , maximum value of 263-1. in java se 8 , later, can use long data type represent unsigned 64-bit long, has minimum value of 0 , maximum value of 264-1. use data type when need range of values wider provided int.
in addition, here's extract long full java se 8 specification: https://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html (4.2.1)
the values of integral types integers in following ranges: long, -9223372036854775808 9223372036854775807, inclusive
so, no. neither java long primitive type nor long class can hold fraction
Comments
Post a Comment