menu
Qamnty
Login
Register
My account
Edit my Profile
Private messages
My favorites
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("…
Ask a Question
Questions
Unanswered
Tags
Ask a Question
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("…
asked
Apr 22, 2022
71.3k
views
4
votes
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");}
Computers & Tech
college
XRobot
asked
by
XRobot
8.4k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
4
votes
Answer:
i think option 2 is correct answer
Step-by-step explanation:
op
Brookemitchell
answered
Apr 28, 2022
by
Brookemitchell
8.5k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Apr 27, 2024
165k
views
Suppose we are making license plates of the form l1l2l3 ???? d1d2d3 where l1; l2; l3 are capital letters in the English alphabet and d1; d2; d3 are decimal digits (i.e., elements of the set f0; 1; 2; 3;
Tuan Ly
asked
Apr 27, 2024
by
Tuan Ly
7.5k
points
Mathematics
high-school
1
answer
1
vote
165k
views
asked
Sep 14, 2024
64.0k
views
A mobile is constructed of light rods, light strings, and beach souvenirs as shown in the figure below. If m4=12.0 g, find values (in g) for the following. (Let d1=3.50 cm,d2=4.60 cm,d3=1.30 cm,d4=5.
IronMensan
asked
Sep 14, 2024
by
IronMensan
8.7k
points
Mathematics
high-school
2
answers
1
vote
64.0k
views
asked
May 4, 2024
192k
views
m1 = 4.7 kg m2 = 4.6 kg m3 = 7.8 kg m4 = 3.3 kg d1 between m1 and m4= 0.11 m d2 between m3 and m4= 0.17 m d3 between m1 and m3= 0.2025m the magnitude of the gravitational force between masses m1 and m2
Idoby
asked
May 4, 2024
by
Idoby
8.5k
points
Physics
college
1
answer
4
votes
192k
views
Ask a Question
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
“What does it mean when we “rework” copyrighted material?”
The book shows how to add and subtract binary and decimal numbers. However, other numbering systems are also very popular when dealing with computers. The octal (base 8) numbering system is one of these.
Seven basic internal components found in a computer tower
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qamnty