[Gambas-user] Infinities and division

BB adamnt42 at gmail.com
Tue Nov 29 15:28:42 CET 2022


On 30/11/22 12:54 am, Benoit Minisini wrote:
> Le 29/11/2022 à 15:23, Benoit Minisini a écrit :
>> Le 29/11/2022 à 15:14, BB a écrit :
>>> I'm not real good on infinite mathematics but
>>>
>>>     If Abs((.Actual - .Predicted) / .Predicted) > 0.005 Then
>>>
>>> throws a "Division by zero (26)" error when .Actual = -Inf and 
>>> .Predicted = (a normal real like) 63.665584
>>>
>>> Is that correct? Because to me it's a very misleading error.
>>>
>>> regards
>>>
>>> bruce
>>>
>>
>> Indeed. It's because "/" raises "Division by zero" as soon as it does 
>> not return a real number.
>>
>
> But should it raise an error in that case, or return the infinites?
>
I'd accept an error just stating "Improper infinite math" or something 
like that. But I accept your answer anyway, it's just that I spent some 
time trying to figure out why 63.665584 equals zero. 🙁

bruce



More information about the User mailing list