top | item 22662399

(no title)

Elrac | 6 years ago

Looking at "Core Language" I was dismayed not to find any builtin floating point data type.

In "Phix vs Conventional Languages" I'm told that "1/2 is always 0.5". And "Library Routines" / "Math" includes sin, cos and tan. What's going on here?

discuss

order

jorams|6 years ago

The type "atom"[1], is described in "Core Language" as follows:

> An atom can hold a single floating point numeric value, or an integer

I don't know why it isn't called "number", but it exists.

The page on atom also mentions:

> It can also hold a raw pointer, such as allocated memory or a call_back address, but that is typically only used when interfacing to external code in a .dll or .so file.

[1]: http://phix.x10.mx/docs/html/atom.htm

Elrac|6 years ago

You're right, I missed that.

But that still leaves the ASCII tree diagram agreeing with the sentence "Phix has just five builtin data types:" while showing (and describing, in the following bullet point list) five data types that don't include "number" or a floating-point type.

So what's left is a minor but consistently repeated error in the doc, on the "Core Language" page.