User:Berni44/RealProblems

From D Wiki
Revision as of 16:46, 8 March 2021 by Berni44 (talk | contribs) (Created page with "==Real Problems== Most people agree, that floating point numbers are weird. At least somewhat. D also features these numbers. It has got three floating point types: <code>fl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Real Problems

Most people agree, that floating point numbers are weird. At least somewhat.

D also features these numbers. It has got three floating point types: float (32 bit) , double (64 bit) and real (largest floating point size available). While the first two are well known, real may differ on different computers (and maybe even with different compilers, but I don't know that for sure).

This in itself is not a problem. If your code needs to produce identical results on different computers, you just stick to double or float. If the code only targets one computer, you may use real for greater precision.

Unfortunately D has got another feature...