subject

Which option is better? Option 1:
double d1 = 0.1; double d2 = 0.2; double d3 = 0.3; double x = (d1 + d2) + d3 ; double y = d1 + (d2 + d3); if (x == y) {System. out. println("Equal");}

Option 2:
double d1 = 0.1; double d2 = 0.2; double d3 = 0.3; double x = (d1 + d2) + d3 ; double y = d1 + (d2 + d3); double z = x - y; double epsilon = 1E-5; if (java. lnag. Math. abs(z) < epsilon) {System. out. println("Equal");}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:30
In vista and windows 7, the appearance and personalization option allows you to change the
Answers: 1
question
Computers and Technology, 25.06.2019 04:30
Consider a list of full names formatted “firstname lastname”, like ["jules verne", "alexandre dumas", "maurice druon"]. write a list comprehension that produces a list with the full names in the format “lastname, firstname”. the resulting list should look like ['verne, jules', 'dumas, alexandre', 'druon, maurice']. the simplest solution may involve a nested comprehension: [ …. for … in [ … for … in … ]].
Answers: 3
question
Computers and Technology, 25.06.2019 08:00
True or false: a power supply is an electrical transformer that regulates the electricity used by the computer.
Answers: 1
question
Computers and Technology, 25.06.2019 10:50
Write a program to convert a person’s height in inches into centimetres and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg) i need .
Answers: 1
You know the right answer?
Which option is better? Option 1:
double d1 = 0.1; double d2 = 0.2; double d3 = 0.3; double x...
Questions
question
Mathematics, 03.08.2019 18:00
Questions on the website: 13722360