CAS: (2^10)! is undefined?
10-27-2018, 03:27 PM
Post: #5
 parisse Senior Member Posts: 1,313 Joined: Dec 2013
RE: CAS: (2^10)! is undefined?
The fact that large integers must be limited in size can of course not be avoided, the limit being smaller on calculators than on PC. The CAS code is based on Giac which is also open-source licensed, you can therefore find useful informations in the source code if you don't want to make a small dichotomoy to find the limit, look in global.cc for FACTORIAL_SIZE_LIMIT (it's certainly possible to raise a little bit the limit, but the biginteger library used on the Prime is not very efficient compared to GMP or MPIR). BTW, the largest factorial that the nspire can compute exactly seems to be 446!

Once you can not compute exactly (and you can't convert to a floating point number), returning undef is a good option, because you are sure that it will remain so in further computation. Introducing an overflow constant would not bring much additional information, but would increase the code complexity because we would have to deal with arithmetic operations like overflow+1=overflow (ok), overflow*0= well is it 0 or undefined? 1/overflow= hum, should I define underflow also? Then, should I defined +overflow and -overflow...?

@sasa: I'm in general open to constructive discussions that can help improve Giac, but please consider that I'm not really a newcomer : I'm coding CAS software since 25 years, I think I know a little bit how to do it. Of course, I may miss something that someone could point to me, but your last post about solving z=sqrt(i) giving "unexpected" results does not help considering your comments very seriously.
 « Next Oldest | Next Newest »

 Messages In This Thread CAS: (2^10)! is undefined? - sasa - 10-27-2018, 03:41 AM RE: CAS: (2^10)! is undefined? - parisse - 10-27-2018, 04:58 AM RE: CAS: (2^10)! is undefined? - sasa - 10-27-2018, 05:13 AM RE: CAS: (2^10)! is undefined? - Voldemar - 10-27-2018, 09:59 AM RE: CAS: (2^10)! is undefined? - parisse - 10-27-2018 03:27 PM RE: CAS: (2^10)! is undefined? - sasa - 10-27-2018, 04:56 PM RE: CAS: (2^10)! is undefined? - John Keith - 10-27-2018, 03:48 PM RE: CAS: (2^10)! is undefined? - parisse - 10-27-2018, 06:31 PM RE: CAS: (2^10)! is undefined? - sasa - 10-27-2018, 07:59 PM RE: CAS: (2^10)! is undefined? - Mark Hardman - 10-27-2018, 08:40 PM RE: CAS: (2^10)! is undefined? - sasa - 10-27-2018, 08:55 PM RE: CAS: (2^10)! is undefined? - Mark Hardman - 10-27-2018, 09:43 PM RE: CAS: (2^10)! is undefined? - CyberAngel - 10-27-2018, 10:04 PM RE: CAS: (2^10)! is undefined? - sasa - 10-27-2018, 10:17 PM RE: CAS: (2^10)! is undefined? - Mark Hardman - 10-27-2018, 10:40 PM RE: CAS: (2^10)! is undefined? - CyberAngel - 10-27-2018, 11:13 PM RE: CAS: (2^10)! is undefined? - NetMage - 10-28-2018, 03:14 AM RE: CAS: (2^10)! is undefined? - parisse - 10-28-2018, 06:17 AM RE: CAS: (2^10)! is undefined? - CyberAngel - 10-28-2018, 09:57 AM RE: CAS: (2^10)! is undefined? - Aries - 10-28-2018, 10:30 AM RE: CAS: (2^10)! is undefined? - parisse - 10-28-2018, 10:33 AM RE: CAS: (2^10)! is undefined? - Komanguy - 11-09-2018, 10:09 AM RE: CAS: (2^10)! is undefined? - Alberto Candel - 10-31-2018, 06:33 PM RE: CAS: (2^10)! is undefined? - Tim Wessman - 11-09-2018, 12:06 PM RE: CAS: (2^10)! is undefined? - compsystems - 11-09-2018, 12:42 PM

User(s) browsing this thread: 1 Guest(s)