+ 1
Can Java work with "long double"
5 Answers
+ 1
Yes, Java supports the `double` data type for representing double-precision floating-point numbers. The `long` data type, however, is specifically for integers, not floating-point numbers. If you need to work with floating-point numbers in Java, you would typically use `double` or `float` for single-precision floating-point numbers.
Example of a `double` variable in Java:
```java
double myDouble = 3.14;
```
If you need higher precision than `double`, you might consider using the `BigDecimal` class for arbitrary-precision arithmetic.
+ 6
There is long type. ( whole numbers)
And double type. ( precision valued numbers)
No long double? What it is?
+ 1
But take a try in cpp
+ 1
Show me how to use long type
+ 1
But not in java.
in java,
long num = 123457890000000_000L;
// no underscore needed but add suffix L for over integer value.