smlnj / legacy

This project is the old version of Standard ML of New Jersey that continues to support older systems (e.g., 32-bit machines).
BSD 3-Clause "New" or "Revised" License
25 stars 10 forks source link

Real32 #304

Open Skyb0rg007 opened 3 months ago

Skyb0rg007 commented 3 months ago

Description

Single precision IEEE floating point numbers often have sufficient precision for many applications, and are used in many binary formats. Additionally, SML/NJ stores Real64.real values as pointers, and the 32-bit variant could potentially have an unboxed representation for additional speed and space savings (on 64-bit installations).

Half-precision IEEE floating point numbers can sometimes be useful as a binary storage format (ex. CBOR), and the 16-bit brain floating point format has support on some processors and is used in some AI applications. These are also options to support (at least for serialization/deserialization to Real64).

Real32 is currently supported by MLton, MLj, and SML.NET.

JohnReppy commented 3 months ago

I plan to add 32-bit reals to the development version of SML/NJ.