Jump to content



Photo
- - - - -

Factorial Bug


  • Please log in to reply
No replies to this topic

#1 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 07 December 2003 - 12:20 AM

The classpad is a nice calc, but the software is a bit imature.

Therefor I started a bug report thread.

I'll kick it off with one bug that annoys me a bit


Doing a factorial of a number larger than 297 doesn't give an answer (directly).
This seems to be a restriction imposed due to the maximum number of digits in an integer number being 611 (297! has 608 digits)
However, it should still be possible when in decimal mode...
It is in fact possible to "fool" the CP to do it, by doing it in 2 expressions (or even 1.. but some trickery is necesary to avoid the Cas system simplifying it and returning the same result as it normally would)
I created a new factorial function, fact(n):
piecewise(n>297,297!*(n!/297!+1)-297!,n!,0)

Obviously this is slower than just performing the factorial directly, so I'de very much like to see this fixed..
NB: Evaluating factorials larger than 297! only works in decimal mode. In normal mode this function will return -297! for any n>297


PS:
Please post bugs, not wishes, dreams and suggestions of improvement, in this thread.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users