Does anyone use single-flonums in Racket?

I don't mean `_float` or `f32vector`s, which convert C `float`s or
32-bit array elements into regular double-precision Racket flonums. I
mean literals like `3.0f0` or functions like `real->single-flonum`,
which produce a Racket number that uses only 32 bits for arithmetic.

Chez Scheme doesn't support single-precision floating-point numbers,
and adding them would be a lot of work --- for no benefit, if it turns
out that no one is using those kinds of numbers.

My guess is that no one uses them currently, because it's rare that
you'd want to trade speed for *im*precision. Single-flonums in Racket
are significantly slower than regular flonums, because they're not
treated as a common case. The only use I can think of, and the one that
inspired the original experiment, is to try to faithfully replicate a C
`float` calculation in Racket, but even that possibility has issues.

If no one uses single-precision floats, then I will suggest that we
remove them from Racket by making numbers like `3.0f0` parse as flonums
and making `real->single-flonum` raise `exn:fail:unsupported`.
Obviously, this would be a backward-incompatible change. But if it
causes little enough trouble, then it could be a good trade to avoid
problems for Racket CS and future platforms.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5ceeaac9.1c69fb81.118e3.f708SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to