[Git][ghc/ghc][master] docs: remove the don't use float hint
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Sat Mar 23 04:23:34 UTC 2024
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
8f7cfc7e by Tristan Cacqueray at 2024-03-23T00:22:44-04:00
docs: remove the don't use float hint
This hint is outdated, ``Complex Float`` are now specialised,
and the heap space suggestion needs more nuance so it should
be explained in the unboxed/storable array documentation.
- - - - -
1 changed file:
- docs/users_guide/hints.rst
Changes:
=====================================
docs/users_guide/hints.rst
=====================================
@@ -273,22 +273,6 @@ Use ``foreign import`` (a GHC extension) to plug into fast libraries:
:ref:`ffi` describes the foreign function interface.
-Don't use ``Float``\s:
- If you're using ``Complex``, definitely use ``Complex Double``
- rather than ``Complex Float`` (the former is specialised heavily,
- but the latter isn't).
-
- ``Floats`` (probably 32-bits) are almost always a bad idea, anyway,
- unless you Really Know What You Are Doing. Use ``Double``\s.
- There's rarely a speed disadvantage—modern machines will use the
- same floating-point unit for both. With ``Double``\s, you are much
- less likely to hang yourself with numerical errors.
-
- One time when ``Float`` might be a good idea is if you have a *lot*
- of them, say a giant array of ``Float``\s. They take up half the
- space in the heap compared to ``Doubles``. However, this isn't true
- on a 64-bit machine.
-
Use unboxed arrays (``UArray``)
GHC supports arrays of unboxed elements, for several basic
arithmetic element types including ``Int`` and ``Char``: see the
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8f7cfc7ee00978fda14f31ce4a56ad4639c07138
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8f7cfc7ee00978fda14f31ce4a56ad4639c07138
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240323/669a4d19/attachment-0001.html>
More information about the ghc-commits
mailing list