Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #41101

Re: Are Floating Point Numbers still a Can of Worms?

From John Harris <niam@jghnorth.org.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: Are Floating Point Numbers still a Can of Worms?
Date 2022-10-15 11:13 +0100
Organization A noiseless patient Spider
Message-ID <tie14h$2lmqv$1@dont-email.me> (permalink)
References <31753076-4806-4dd3-8577-40a4ed23b57dn@googlegroups.com> <tidnpc$1vh5$1@gioia.aioe.org>

Show all headers | View raw


On 15/10/2022 08:33, R.Wieser wrote:
> Mostowski,
> 
>>> 1889**29
>> 1.0250068783051206e+95
>>> Number(BigInt(1889)**BigInt(29))
>> 1.0250068783051207e+95
> 
> You're looking at the lowest significant digit of a 64-bit IEE float - which
> might not have all of its bits defined and thus being zero - against a
> "BigFloat" digit which, for that digit, has all its bits defined.
> 
> IOW, you could be looking at a 01xxb (with "x" being zero) for the 64-bit
> float against a 0110b for the BigInt float.
> 
> Bottom line : the lowest significant digit of a float is most always
> incomplete, and as such might not accuratily represent the number it was
> created from.
> 
> Regards,
> Rudy Wieser

There's also the translation from binary to decimal to consider.

Anyway, floating point numbers are accurate enough to indicate the 
relativity effect of someone going past you on a bicycle so I don't 
think there's a problem.

   John

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <bursejan@gmail.com> - 2022-10-14 15:52 -0700
  Re: Are Floating Point Numbers still a Can of Worms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-10-15 01:52 +0100
  Re: Are Floating Point Numbers still a Can of Worms? "R.Wieser" <address@not.available> - 2022-10-15 09:33 +0200
    Re: Are Floating Point Numbers still a Can of Worms? "R.Wieser" <address@not.available> - 2022-10-15 10:00 +0200
    Re: Are Floating Point Numbers still a Can of Worms? John Harris <niam@jghnorth.org.uk.invalid> - 2022-10-15 11:13 +0100
      Re: Are Floating Point Numbers still a Can of Worms? "R.Wieser" <address@not.available> - 2022-10-15 13:43 +0200
        Re: Are Floating Point Numbers still a Can of Worms? John Harris <niam@jghnorth.org.uk.invalid> - 2022-10-15 15:56 +0100
          Re: Are Floating Point Numbers still a Can of Worms? "R.Wieser" <address@not.available> - 2022-10-15 17:44 +0200
  Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <janburse@fastmail.fm> - 2022-10-15 14:25 +0200
    Re: Are Floating Point Numbers still a Can of Worms? "R.Wieser" <address@not.available> - 2022-10-15 16:31 +0200
      Re: Are Floating Point Numbers still a Can of Worms? John Harris <niam@jghnorth.org.uk.invalid> - 2022-10-15 16:22 +0100
        Re: Are Floating Point Numbers still a Can of Worms? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-10-15 17:04 +0100
          Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <bursejan@gmail.com> - 2022-10-15 09:47 -0700
            Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <janburse@fastmail.fm> - 2022-10-15 18:51 +0200
              Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <bursejan@gmail.com> - 2022-10-22 14:35 -0700
                Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <bursejan@gmail.com> - 2022-11-21 09:02 -0800
  Re: Are Floating Point Numbers still a Can of Worms? Julio Di Egidio <julio@diegidio.name> - 2022-10-17 02:00 -0700
    Re: Are Floating Point Numbers still a Can of Worms? Mostowski Collapse <bursejan@gmail.com> - 2022-10-18 07:40 -0700

csiph-web