[Cuis-dev] What/Where is Infinity and NegativeInfinity?

Juan Vuletich juan at cuis.st
Sun Jun 23 15:33:09 PDT 2024


Hi Nafiz,

On 6/23/2024 12:33 PM, Nafiz Islam via Cuis-dev wrote:
> What/Where is Infinity and NegativeInfinity?

They are class variables in class Float.

> I see Infinity and NegativeInfinity being referenced in BoxedFloat64.
>
> 'From Cuis7.1 [latest update: #6472] on 23 June 2024 at 11:31:09 am'!
>
> !BoxedFloat64 methodsFor: 'testing' stamp: 'jmv 8/1/2019 16:42:00'!
> isInfinite
>     "Return true if the receiver is positive or negative infinity."
>
>     ^ self = Infinity or: [self = NegativeInfinity]! !
>
> But when I try to "Do it" in the Workspace, it returns unknown variable.

Class variables are not global, and are not directly accessible in a 
Workspace. They are available inside the Float hierarchy. So, if you 
evaluate them inside the #isInfinite mehod, there they are. More 
interesting, click on the [class vars]  button and select any of them. 
You'll get a browser showing all methods using them. In particular, 
there are two methods that answer them. This is the way to access them 
from a Workspace, from from any other class in the system.

Cheers,

Pd. To be able to send messages to this list, you need to be suscribed. 
I approved this one by hand as an exception.

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich



More information about the Cuis-dev mailing list