a/(a+b)
. That function threw a ZeroDivisionError
at me this afternoon, so I decided to change the equation to a/(a+b+sys.minfloat)
, because I felt that was more elegant than writing a conditional function to check if (a + b) == 0
. Turns out there is no 'minfloat' in the sys module, so I decided to write a function to calculate the smallest float myself.
>>> def minfloat(guess):
while(guess * 0.5 != 0):
guess = guess * 0.5
return guess
>>> minfloat(+1.0) # minimum positive value of a float
4.9406564584124654e-324
>>> minfloat(-1.0) # minimum negative value of a float
-4.9406564584124654e-324
But I couldn't stop there. Now I had to write a function to calculate the largest possible floating point value in Python, just for kicks:
>>> def maxfloat(guess = 1.0):
while(guess * 2 != guess):
guess = guess * 2
return guess
>>> maxfloat(+1.0) # maximum positive value of a float
inf
>>> maxfloat(-1.0) # maximum negative value of a float
-inf
This is interesting. Let's find out more about this "inf" value:
>>> inf
Traceback (most recent call last):
File "", line 1, in
inf
NameError: name 'inf' is not defined
>>> float("inf")
inf
>>> inf = maxfloat()
>>> inf + inf
inf
>>> inf - inf
nan
>>> 1 / inf
0.0
>>> 1/(-inf)
-0.0
Finally, check the relationship between minfloat and maxfloat:
>>> 1 / minfloat(1.0)
inf
>>> 1 / minfloat(-1.0)
-inf
jordan 1
golden goose shoes
off white hoodie
kobe sneakers
kyrie irving shoes
stone island
adidas yeezy
golden goose
curry shoes
jordan retro
yanmaneee
July 16, 2021 at 4:16 PMPriya Singh and Mumbai Escorts are up for all your physical and mental needs. Experience the Mumbai Escorts
Call Girls and make your time full of Erotic Pleasure.I am very beautiful and sexy in appearance and I am 21 years old, and my figure is 37, 30, 36 my height is 5 feet 2 inches. I am a very hot Independent Female Escort Service
.
Visit My Website https://escortagencyinmumbai.com/
Bandra Escorts
Mumbai Call Girls
Andheri Escorts
Juhu Escorts
lovepriya1
July 19, 2021 at 1:33 AMmoncler jackets
yeezy 380
curry shoes
hermes belt
chrome hearts online store
supreme hoodie
moncler outlet
supreme outlet
golden goose
curry 8
yanmaneee
July 19, 2021 at 6:09 PMkd 12
jordans
bathing ape
authentic jordans
retro jordans
lebron shoes
yeezy supply
hermes birkin
yeezy boost 350
supreme outlet
yanmaneee
July 19, 2021 at 6:09 PMJaipur Escorts
Jaipur Call Girls
Jaipur Call Girls Service
Call Girls in Jaipur
Vip Call Girls in Jaipur
Independent VIP Escorts in Jaipur
Cheap Call Girls in Jaipur
High Profile Call Girls in Jaipur
Russian Call Girls in Jaipur
Airhostess escorts in Jaipur
Housewife Jaipur Escorts
Jaipur College girls escorts
College Girls Escorts in Jaipur
High Class Escorts Service in Jaipur
Jaipur Busty Call Girls
Busty Jaipur Escorts
Jaipur Call Girls Service
Jaipur High Class Call Girls
Jaipur Escorts Service
Escorts Service in Jaipur
Nude Model In Jaipur
Jaipur Escorts Girls
July 20, 2021 at 1:46 AMEnjoy the Passionate service of Hyderabad Escorts. Premium Escorts in Hyderabad for Utmost Entertainment. Truly secured doorway to reach the lovely Hyderabad escort service profiles. Visit now - hyderabadescortsagency.co.in.
Hyderabad Escorts
Hyderabad Escort
Independent escorts in Hyderabad
Hyderabad independent escorts
Hyderabad escorts service
Hyderabad escort services
Escorts services in Hyderabad
Hyderabad escort model
High class escorts in Hyderabad
Hyderabad escort models
KomalChennai69
July 23, 2021 at 9:52 PMCall girls in Hyderabad
Escorts model in Hyderabad
Escorts agency in Hyderabad
Hyderabad escorts agency
Hyderabad escorts housewife
Escorts girls in Hyderabad
Hyderabad escorts services
Call Girls Service in Hyderabad
Escorts in Hyderabad
Hyderabad call girls
KomalChennai69
July 23, 2021 at 9:54 PMRajahmundry Escorts
Secunderabad Escorts
Shamshabad Escorts
Vijayawada Escorts
Visakhapatnam Escorts
Vizag Escorts
Patna Escorts
Manikonda Escorts
Jaipur Escorts
Rewari Escorts
KomalChennai69
July 23, 2021 at 9:55 PMGoa Escorts
Pune Escorts
Pune Escorts
KomalChennai69
July 23, 2021 at 9:57 PMHi I am Arpita Jain. I am a Mumbai based girl. I offer services and so do my group of girls. There are many models working for me. If you are looking specifically for young girls, I have many College girls.
Mumbai Call Girls
Juhu Escorts Service
Andheri Escorts
Bandra Escorts Service
Navi Mumbai Escorts
Mumbai Hotel Sex
Russian Escorts In Mumbai
Bombay Call Girls
sweetheart
July 24, 2021 at 12:22 AMDownload PES Mobile for Android
Eddie Blogger
July 30, 2021 at 5:59 AMBook hot and busty Call Girls in Hyderabad to fulfill your demand & find Hyderabad Escorts service for sex satisfaction at low rate, avail 24/7. Visit us:- https://bit.ly/3yN7pYw
Secunderabad Escorts
Hyderguda Escorts
Lb-Nagar Escorts
Lingampally Escorts
Malakpet-Extension Escorts
Mehdipatnam Escorts
Moosapet Escorts
Pathargatti Escorts
Qutubullapur Escorts
Kohinoor Fun Club
August 13, 2021 at 4:13 AMBandlaguda Escorts
Bhagyanagar Escorts
Chintalkunta Escorts
Madhapur Escorts
Vijaya-Nagar Escorts
Shamshabad Escorts
Charminar Escorts
Lakdikapool Escorts
Manikonda Escorts
Mallapur Escorts
Kohinoor Fun Club
August 13, 2021 at 4:14 AMRajahmundry Escorts
Chettipunniyam Escorts
Ameerpet Escorts
Bagh-Lingampally Escorts
Chitlapakkam Escorts
Chandrayangutta Escorts
Dilsukhnagar Escorts
Doodh-Bowli Escorts
Hafeezpet Escorts
Hill-Firt Escorts
Kohinoor Fun Club
August 13, 2021 at 4:14 AMKeesara Escorts
Uppal-Kalan Escorts
Ghatkesar Escorts
Hayathnagar Escorts
Rajendranagar Escorts
Sr-Nagar Escorts
Prakash-Nagar Escorts
Somajiguda Escorts
Saifabad Escorts
Chintal-Basti Escorts
Kohinoor Fun Club
August 13, 2021 at 4:17 AMChikkadpally Escorts
Himayatnagar Escorts
Ramnagar Escorts
Nallakunta Escorts
Tilaknagar Escorts
Badichowdi Escorts
Aghapura Escorts
Boggulkunta Escorts
Chilkalguda Escorts
Kavadiguda Escorts
Kohinoor Fun Club
August 13, 2021 at 4:17 AMChoutuppal Escorts
Indresham Escorts
Ameenpur Escorts
Gajularamaram Escorts
Izzathnagar Escorts
Ankushapur Escorts
Kanchan-Bagh Escorts
Kistareddypet Escorts
Suraram Escorts
Tukkuguda Escorts
Kohinoor Fun Club
August 13, 2021 at 4:20 AMYadagirigutta Escorts
Bibinagar Escorts
Bongloor Escorts
Chilkur Escorts
Puppalaguda Escorts
Saroor-Nagar Escorts
Rajendra-Nagar Escorts
Saidabad Escorts
Rampally Escorts
Nagulapally Escorts
Kohinoor Fun Club
August 13, 2021 at 4:20 AMBangalore Escorts
Bangalore Escorts Service
Chennai Escorts
Kohinoor Fun Club
August 13, 2021 at 4:21 AMHurry Up to Book Now a Masterpiece Sizzling Escorts Hyderabad, and enjoy your night.
We also provide our services in Mumbai: Escort in Mumbai
Roshni Mehta
August 18, 2021 at 2:45 AMHow to report cyber crime to FBI
https://inflowpost.com/how-to-report-a-cyber-crime-to-fbi-46
Unknown
August 18, 2021 at 1:20 PMHello friend, I have read your web page. Really it is relevant to dedicated subject. Keep it continue with this website. My name is Arpita Jain. I am an Mumbai independent female model. I am very hot and sexy girl. I deal in Bandra Escort Service. I provide my Mumbai premium services in five star hotels. I am available for outcall and incall in lowest price. If you want to book my service kindly contact me through my website.
Bandra Escorts
Bandra Escorts
Bandra Escorts
arpitajain
August 31, 2021 at 12:07 AMI found the information you provided to be very helpful. I like your blog very much. It was a very useful experience for me. If you are planning an outdoor trip, then I suggest you check out the Best 4 Person Tent. Here are the best tents for four people that you can buy.
Unknown
September 1, 2021 at 2:43 AMThank you for sharing this wonderful post. Thank you for the informative information. I really appreciate your effort toward the reader. I suggest reading the blog post on Camera and Microphone Hacking and protect yourself from hacking. There are several apps available on your phone or computer that can access your camera, microphone, and other features, including location information. Below are the steps you can follow to check which apps have asked for permission and revoke previously granted permissions.
James L Willis
September 2, 2021 at 2:49 AMHello viewer’s
I don’t have much to say there are so may scammers going on online so we cant detect the real herbal medicine doctors. Thank GOD for leading me, please don’t ignore this post is real Dr Emmanuel, is a real herbal Doctor, he cured me from Herpes virus, i am living so happy and free , i was fully recovered within 4 weeks of usage of dr Emmanuel herbal medicine ,please viewers out there that have any deadly disease don't fail to contact him via his email; nativehealthclinic@gmail.com or WhatsApp/Call: +2348140073965 thanks once again to dr Emmanuel GOD bless you abundantly
he also cured HIV/AIDS,CANCER,GENITAL WART,COPD,BRAIN TUMOR
anna lucas
September 12, 2021 at 12:53 PMDo you need a sugar mummy or sugar daddy if yes call us on 09037906223
Unknown
October 9, 2021 at 12:12 PMNice article I love it very informative. you can view Best 10 Moviesrulz Alternatives & Similar Websites thanks
richrite
October 11, 2021 at 7:01 AMIn the accompanying Profile, I will impart to you my contemplations about Tips for Improving Your Typing Speed & Accuracy. Here is more data on How To Increase Typing Speed. A Profile named How to Increase Typing Speed can be seen as here. In case you're searching for tips on the best way to type quicker or how to breeze through a composing assessment, this Profile will help. The accompanying ideas will help you. Continue to peruse to figure out how you can further develop your composing speed. Learn more by clicking here. Tell us what you think subsequent to perusing the full Profile. Much appreciated.
Harris Dejesus
October 29, 2021 at 3:10 AMToday we cannot imagine our life, our business without proper database. We always like to analysis data and get report from data so that they can manage their life and their organization in proper order. That means that there is highly demand of database. database is not only important for storing the data in proper order .Beside this there is also numbers of application where it pays the big roles to perform efficiently. here are some point that he mention there
Ravi Varma
November 16, 2021 at 9:25 PMGENUINE BANK GUARANTEE (BG) AND STANDBY LETTER OF CREDIT (SBLC) FOR BUY OR LEASE AT THE BEST AVAILABLE RATES
We offer certified and verifiable financial bank instruments via Swift Transmission from a genuine provider capable
of taking up time bound transactions.
FOR LEASING OF BG/SBLC
MINIMUM FACE VALUE OF BG/SBLC = EUR/USD 1M
LEASING FEE = 4%+2%
FOR PURCHASE OF FRESH CUT BG/SBLC
MINIMUM FACE VALUE OF BG/SBLC = EUR/USD 1M
PRICE = 32%+2%
Our BG/SBLC Financing can help you get your project funded,
loan financing by providing you with yearly.
RWA ready to close leasing with any interested client in few banking days
I will be glad to share with you our working procedures.
Name : Thomas Wolfgang
Email : inquiry.fastfunding@gmail.com
Skype : inquiry.fastfunding@gmail.com
Unknown
November 25, 2021 at 3:59 PMWow
Jaunty
December 9, 2021 at 12:56 PMAdmin
December 9, 2021 at 1:19 PMThank you for this informative article. I learned so much from it. Our free email signature maker will help you build a brand identity with a personalized email signature. Create your own email signature online with our free tool. Easily create a signature for your email using our email signature generator
Unknown
December 14, 2021 at 1:13 AMhttps://www.surveenmondal.com/
Surveen Mondal
January 4, 2022 at 11:32 PMThanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
Selenium Course Training in Chennai
RPA Course Training in Chennai
AHMED
January 5, 2022 at 2:22 AMTop 5 Best & Cheapest Android Phones in Nigeria 2022
Olushola
February 25, 2022 at 9:11 AMI simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
Full stack Online Training
AHMED
March 4, 2022 at 5:46 AMThe maximum value any floating-point number can be is approx 1.8 x 10308. Any number greater than this will be indicated by the string inf in Python.
Winchester VA Basement Waterproofing
Roselyn
March 7, 2022 at 9:44 PMThat's very knowledgeable for me. Keep posting! See more at Newport Beach Tree Service
Roselyn
March 29, 2022 at 5:33 PMPython supports 3 types of numbers: integers, float and complex number. If you want to know what type a value has you can use type() function. Thanks by the way! You can also visit our Tree Service Charlottesville
Roselyn
March 29, 2022 at 8:38 PMThank you for sharing this wonderful blog post, Keep posting for more! Visit us at https://www.concreteharrisonburg.com/
Roselyn
March 31, 2022 at 9:52 PMThis is nice tips for programming. Check out more info here.
John Hartman
April 13, 2022 at 6:03 AMPython float values are represented as 64-bit double-precision values. View more about Spokane Kitchen Remodel
Roselyn
April 17, 2022 at 7:57 PMA floating point number, is a positive or negative whole number with a decimal point. Get more info about
AC Repair Spokane.
Roselyn
April 17, 2022 at 8:01 PMthanks to you i learn a lot from this information. poker online
IDN Poker
May 23, 2022 at 10:46 PMGreat content and comments.. if you are interested in food safety practices, you can check this page out: https://www.explain4u.com/
Admin
June 20, 2022 at 2:54 AMHello Guys Enough already
Yesterday night was loaded!!!!!
*If you haven't watched the replay of the session we had yesterday, then you're are missing a whole lot of stuff*
Here is the replay link to the class we had yesterday, rush niw to YouTube and watch it��
https://shrinke.me/jx4Ey
*I'll be pulling down the link soon*
Almost 2400 people have now streamed this‼️‼️
Rbempire
July 19, 2022 at 4:18 AMAmazing blog. Thanks for sharing. basement-repair-wichita-ks
Beckman
July 22, 2022 at 3:05 AMInteresting and helpful blog. colorado springs concrete contractors
Beckman
July 23, 2022 at 3:16 AMThanks for sharing such a nice blog. Looking for more. www.fencecompanyspringfieldil.com
Beckman
July 24, 2022 at 11:55 PMAs a human being, if your inform u will surely be transform.....what make man poor is not spiritual battle or village people ....what makes man poor is simply because ,(people pass over opportunity repeatedly) {POOR}, with a wrong though of things they should check and try to confirm it authenticity before drawing conclusions...����� Check out that link and see the favour it will return to u and thank me letter. Good luck!
https://www.web5project.io/referral/cNd13y
Gabriel
October 13, 2022 at 12:22 PMYour blogs are really good and informative, keep sharing such good content.
10 Marla Plots for Sale in Lahore
Alina Haris
October 28, 2022 at 4:03 AMPython uses 64-bit double-precision numbers to represent float values. Any floating-point number can have a maximum value of approximately 1.8 x 10308.
Learn more also about Tree Pruning Spokane
Roselyn
November 23, 2022 at 8:31 PMYour Article is so good and informative thanks for sharing this content www.concreteoakville.com
Anonymous
November 28, 2022 at 2:25 AMThank you for this kind of information. Check this out Interior Window Cleaning
Anonymous
November 29, 2022 at 8:59 PMAwesome post! Thanks for this. https://www.drywallservicesvictoria.com/
Anonymous
November 29, 2022 at 10:00 PMThis site is interesting and indeed, very helpful. Thanks for sharing this! https://www.windowcleanersburnaby.com
Guest
November 30, 2022 at 4:26 PMYour sharing in the article is very meaningful, the content is very rich and contains good things. Kitchener Appliance Services
Anonymous
December 1, 2022 at 1:41 AMFantastic! I think You put a lot of effort to create this article. I appreciate your work. check site
Anonymous
December 6, 2022 at 2:30 AMIt's an amazing and helpful source of information. I'm glad you shared this useful info with us. Sherwood Park Personal Trainer
Anonymous
January 4, 2023 at 4:46 AMThis is interesting post! Thanks for the share. my website
Guest
January 5, 2023 at 11:59 PMChecklist For a Website Development | | |
Checklist For a Website Development | | |
Best Website Design Company In Delhi In 2023 | | |
Website Designing Company in Delhi | | |
8 Ways to Promote your Website in 2022 - Web Solution Centre | | |
Best Provider for Search Engine Optimization in Delhi | | |
Top 3 Website Development Companies in Delhi - 2023 | | |
Gurjeet Singh
February 4, 2023 at 12:01 AMThanks for sharing this information. So great! https://truckpartsuperstore.ca/
Angel17
February 4, 2023 at 4:11 AM