Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:46:46+00:00 2026-06-14T01:46:46+00:00

Assuming I have a program with the function def fakultaet(x): if x>1: return(x* fakultaet(x-1))

  • 0

Assuming I have a program with the function

def fakultaet(x):
    if x>1:
        return(x* fakultaet(x-1)) 
    else:
        return(1)

that returns the factorial of a given number, I need to calculate

1.0/fakultaet(200)

but I get an overflow error: long int too large to convert to float.

How can I solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:46:47+00:00Added an answer on June 14, 2026 at 1:46 am

    You could try this:

    from decimal import Decimal
    
    def fakultaet(x):  # as you have it currently
        if x>1:
            return(x * fakultaet(x-1)) 
        else:
            return(1)
    
    print Decimal(1.0) / fakultaet(200)
    

    Output:

    1.267976953480962421753016371E-375
    

    Oh, and also, there is a factorial function in the math module already, just include from math import factorial at the top of your file to obtain access to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that needs to run a function M times per iteration,
I have a Lua function that, given n, generates all permutations of the series
I have created a program that wehn the calculate button is pressed, an average
Assuming I have a ASP.NET MVC 3 application that runs in a web farm
Assuming I have the following two JQuery functions - The first, which works: $(#myLink_931).click(function
I have a program that takes characters from the buffer to form a string.
I have a program that displays an animation with a fixed frame rate (say
I have a program in C# that I want to get a news feed
I think I am right in thinking that if I have a program like
I have seen this on a program that I am tinkering: static const void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.