1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ber [7]
3 years ago
13

Are there any output differences between floats and doubles?

Computers and Technology
1 answer:
lana [24]3 years ago
5 0

Explanation:

The precision in double values is twice as compared to float values.Hence double have smaller rounding errors as compared to float variables .A double is of 64 bits and float is of 32 bits usually hence floats have more rounding errors and on more number than doubles.Double has 15 decimal digits of precision and float has only 7 decimal digits for precision.

You might be interested in
[20 pts] Write the function rectangle(perimeter, area), which takes two positive integers, perimeter and area. It returns an int
MrRissso [65]

Hi, you haven't provided the programing language in which you need the code, I'll explain how to do it using Python, and you can follow the same logic to make a program in the programing language that you need.

Answer:

import math

def rectangle(perimeter, area):

   l1_1 = (perimeter+math.sqrt((perimeter**2)-(16*area)))/4

   l1_2 = (perimeter-math.sqrt((perimeter**2)-(16*area)))/4

   l2_1 = area/l1_1

   l2_2 = area/l1_2

   print(l1_1,l2_1)

   print(l1_2,l2_2)

   if l1_1.is_integer() and l2_1.is_integer() and l1_1>0 and l2_1>0:

       return(int(max(l1_1,l2_1)))

   elif l1_2.is_integer() and l2_2.is_integer() and l1_2>0 and l2_2>0:

       return(int(max(l1_2,l2_2)))

   else:

       return(None)

Explanation:

  • We import math to make basic operations
  • We define the rectangle function that receives perimeter and area
  • We calculate one of the sides (l1_1) of the rectangle using the quadratic equation to solve 2h^2 - ph + 2a = 0
  • We calculate the second root of the quadratic equation for the same side (l1_2)
  • We calculate the second side of the rectangle using the first root on w = a/h
  • We calculate the second side of the rectangle using the second root on w= a/h
  • We verify that each component of the first result (l1_1, l2_1) is an integer (using the build-in method .is_integer) and greater than 0, if True we return the maximum value between them (using the max function) as w
  • If the first pair of sides evaluate to False we check the second root of the equation and if they meet the specification we return the max value
  • if all the if statements evaluate to false we return None to indicate that not positive or integer sides were found

7 0
3 years ago
You have a MySQL database running on an EC2 instance in a private subnet. You can connect via SSH, but you are unable to apply u
AnnZ [28]

Answer:

Ensure that "Source/Destination Checks" is disabled on the NAT instance.

Explanation:

A NAT (Network Address Translation) instance is, like a bastion host, an EC2 instance that lives in your public subnet. A NAT instance, however, allows your private instances outgoing connectivity to the internet while at the same time blocking inbound traffic from the internet.

Many people configure their NAT instances to allow private instances to access the internet for important operating system updates. Patching your OS is an important part of maintaining instance level security.

NAT device enables instances in a private subnet to connect to the Internet or other AWS services, but prevents the Internet from initiating connections with the instances.

NAT devices do not support IPv6 traffic, use an egress-only Internet gateway instead.

5 0
3 years ago
Which of the following could have a negative impact a planned route?
Nata [24]

Answer:

B

Explanation:

8 0
3 years ago
What is the full form of PDA? HELP ME PLZ-​
finlep [7]

Answer:

Patent ductus arteriosus (PDA)

Explanation:

Patent ductus arteriosus (PDA) is a medical condition in which the ductus arteriosus of a person fails to close after birth.

6 0
2 years ago
Read 2 more answers
What is a batch processing system
iogann1982 [59]
<span>A batch processing system is the execution of a series of jobs in a program on a computer without manual intervention</span>
4 0
3 years ago
Other questions:
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • Write a program with a loop that lets the user enter a series of positive integers. The user should enter −1 to signal the end o
    7·1 answer
  • If your TV was showing a flat black or blue screen, or had "snow", what steps would you take to fix it?
    13·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • How does this happen on brainly????
    12·2 answers
  • Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
    7·1 answer
  • I really need this done Thank you!!
    6·1 answer
  • I live in Pennsylvania which observes eastern standard time.
    13·1 answer
  • ¿Es aquel panel que controla la estructura de la tabla dinámica?
    14·2 answers
  • What is lossless compression
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!