How to write a function that find the largest floating point

Assignment Help Python Programming
Reference no: EM132357045

Question

1) How to write a function that finds the machine epsilon by determining the smallest floating point number larger than 1 that can be stored? (This should return the base 2 exponent for this number)

2) How to write a function that finds the largest floating point number?

3) How to write a function that finds the smallest floating point number?

Here is the code you have so far. (just have to modify this code to find those numbers..)

n = 1
x = 2.**(-n)
while 1 + x !=1:
n += 1
x = 2.**(-n)
print(n - 1)

Reference no: EM132357045

Questions Cloud

How to plot taylor series approximation along with graph : How to describe the main features of this graph and how those features relate to the loss of precision when numbers of very different magnitudes.
What was the ethical mistake : Please find a company that made an ethical mistake and answer the following questions: What was the ethical mistake? How did it affect the company?
Describe the actions that officers can take to reduce danger : It is well known that undercover operations can be very dangerous for officers. Identify three (3) possible dangers that officers involved in undercover.
What are two causes of hunger and two problems that result : Where do most of the world's hungry live? What are two causes of hunger and two problems that result?
How to write a function that find the largest floating point : How to write a function that finds the machine epsilon by determining the smallest floating point number larger than 1 that can be stored?
Response to a healthcare challenge : When an innovative response to a healthcare challenge is proposed, what happens if it is perceived as a threat to the existing system?
Why should nurses know about computer programming : Why should nurses know about computer programming?
Develop a investigation plan including given details : A child was playing in a local park with his brother. A car pulled up as they were leaving the playground. A man inside the car motioned for the two (2) boys.
Advising on promotional activities to new employees : Could you please help me explain on how to advising on promotional activities to new employees?

Reviews

Write a Review

Python Programming Questions & Answers

  Design and implement a python program which plays poker

The goal of this project is to gain practice with use of classes and creating functions. You will design and implement a Python program which plays simplified Texas Hold'em Poker.

  Code a console-based program in python

CP1404/CP5632 2016 SP2/22/52 Assignment 1 - Shopping List 1.0. You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selectio..

  Create an html page named index that contains links to each

Given a folder with at least five 5 images in it, create an HTML page named index that contains links to each JPEG file in the directory.

  Write a program that asks the user to enter the price

Write a program which asks the user for the number of miles they drove on a trip. Write a program that asks the user to enter the price of a purchase order.

  Write the python program to add two numbers

write the Python Program to Print Hello world? write the Python Program to Add Two Numbers? write the Python Program to Find the Square Root? write the Python Program to Calculate the Area of a Triangle.

  Prepare an original 2d game code in cocos2d python

Project may be completed using Linux, Windows, or OS X. If you use OS X, you may use Spritekit instead of Cocos2D.

  Design and implement mini-missions in the haunted house

Create a cheat commands in the game so player can pick up any item he wants from any location in the map. You have to name this cheat command 'giveme'

  Write a loop that counts the number of space

Write a loop that counts the number of space characters in a string. Recall that the space character is represented a

  Develop algorithmic solutions to programming problems

HS1031 - Introduction to Programming - Holmes Institute - determine whether a triangle is a ‘right triangle'. A right triangle is a triangle where the square

  Python program that reads in a series of positive integers

Write a Python program that reads in a series of positive integers and writes out theproduct of all the integers less than 25 and the sum of all the integers greater than or equal to 25. Use 0 as a sentinel value

  Asks the user to enter a stores sales for each day of week

Write a program that asks the user to enter a store's sales for each day of the week. The amounts should be stored in a list.

  Write a python script for the ice cream ordering system

ICT702 : Write a Python script for the ice cream ordering system.Your program must store the prices of the individual items (cones, scoop flavours and toppings)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd