My goal is to generate random numbers that all have decimal precision errors. Here are some examples of types of numbers I would like to generate: 1.8181818723678589 1.2727272510528564 0….

My goal is to generate random numbers that all have decimal precision errors. Here are some examples of types of numbers I would like to generate: 1.8181818723678589 1.2727272510528564 0….

I’ve seen a bunch of solutions for this question but no matter what I try, IDEA still reports an error. Consider the following block: double testDouble= customClass.stream() .mapToDouble(…

I have encountered this problem and i couldn’t find the solution. There is a 2D array with only zeros and ones in it (the size of the array doesnt really matter, i worked with 10×10). Zero means dead …

My problem is how can I implement without the Scanner method and with Math.round and Math.pow? Here is my code: import java.util.Scanner; public class BMI{ public static void main(String …

I am trying to sort a Collection. I cant seem to get my code to work with what I have found online. Collection: [104.131119, 104.188937, 93.174548, 100.533096, 97.902247, 98.608619, 93.380054, 106….

Im a student whos making a simple grading system and Im struggling on how to do this when I type in a specific number it go down to else bypassing my else-if statements the numbers are 98, 67, 98, 80 …

I am very confused on how a declared double data type would lead to the intellij ide to believe I was requiring a int to declare. Can someone give me some insight on this? Here is the code in a …

I understand that BigDecimal is the most accurate way to express currency because treating currency values as a floating-point data type tends to cause rounding errors. However, I also understand that …

I am facing an issue related to converting double to float. Actually, I store a float type, 23423424666767, in a database, but when we get data from the database in the below code, getInfoValueNumeric(…

Is there anyway to convert from double value to BigInteger? double doubleValue = 64654679846513164.2; BigInteger bigInteger = (BigInteger) doubleValue; I try to cast it but it didn’t work.