Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: fb39ca4 on July 03, 2011, 03:29:00 pm

Title: How are exceptions handled?
Post by: fb39ca4 on July 03, 2011, 03:29:00 pm
How does ndless handle exceptions? I specifically want to know about [explosion]divide by zero.[/explosion]
Title: Re: How are exceptions handled?
Post by: z80man on July 03, 2011, 03:49:47 pm
If the ARM is anything like the SuperH (which it very much is) then no automatic exception is generated for divide by 0. Instead an undefined result is what happens. For an exception there must be a specific test for 0 before division begins. This would be done as a conditional statement and not as an internal exception processing. I would though confirm this with someone who actually does low-level nspire dev such as calc84
Title: Re: How are exceptions handled?
Post by: fb39ca4 on July 03, 2011, 04:01:29 pm
So what would the value of undefined be? So I can check for it and abort the iteration of the loop it is in.
Title: Re: How are exceptions handled?
Post by: z80man on July 03, 2011, 04:07:39 pm
mathematically speaking it should be infinity or negative infinity which floating points represent properly but for integers I believe it would just be 0 but once again I'm not sure.
Title: Re: How are exceptions handled?
Post by: AngelFish on July 03, 2011, 04:30:02 pm
Ndless might actually generate "exceptions" because of how compilers handle floating point arithmetic. These of course wouldn't be hardware exceptions without an FPU, but it might be possible to catch them.