POV-Ray : Newsgroups : povray.off-topic : That's got to be one of the stupider design choices I've seen : Re: That's got to be one of the stupider design choices I've seen Server Time
4 Sep 2024 11:17:54 EDT (-0400)
  Re: That's got to be one of the stupider design choices I've seen  
From: Warp
Date: 19 Feb 2010 04:58:06
Message: <4b7e60ae@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   12 yes, but are you sure 0.3 can be converted from double to float without
> losing precision? (Not that it really matters with literals, though...)

  Answering my own question, the bit pattern for 0.3 is:

0 01111111101 0011001100110011001100110011001100110011001100110011

(see http://en.wikipedia.org/wiki/Double_precision_floating-point_format
for the meaning.)

  This makes be believe that 0.3 is actually not accurately representable
with base-2 floating point numbers, and hence converting from double to
float does lose precision, technically speaking.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.