Why are double-precision values called Float?

Coming from an AS3 and C# background, it seems sensible that double-precision values are known as Number or double. However, Haxe uses a non-standard Float moniker for double-precision values. What is the rationale behind this? And in languages that support single-precision float (C#), what is the Haxe type for that?

Looking at the generated source files in C# the haxe Float are c# double.

Not sure why it’s like that, maybe something to do with the lower common denominator between all platforms.

But after all that’s not really an issue since double precision is “superior” to single precision float, so you can pretend they are single precision.

1 Like

There aren’t many use-cases where you’d actually need the single-precision option, and most of those are covered by OpenFL’s Float32Array class.

1 Like

Despite the use of terms in other languages, I believe the simple answer is “integer” versus “floating point”, and that as a matter of having only two data types here, the sizes are equivalent to “long” and “double” if I recall properly. In most cases, I think the brevity is better, but I think that improvements in typed arrays will allow for high-performance use of exactly the data sizes we want, for the cases where it really really matters :slight_smile: