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


Groups > comp.lang.java.programmer > #7790

Re: higher precision doubles

From Jan Burse <janburse@fastmail.fm>
Newsgroups comp.lang.java.programmer
Subject Re: higher precision doubles
Date 2011-09-11 13:50 +0200
Organization albasani.net
Message-ID <j4i7au$7d1$1@news.albasani.net> (permalink)
References (1 earlier) <strictfp-20110806003831@ram.dialup.fu-berlin.de> <j1k4db$1n2$1@news.albasani.net> <j4hev1$lho$1@speranza.aioe.org> <a3e5037d-d719-4cab-b903-8849933f52a7@glegroupsg2000goo.googlegroups.com> <j4i63n$4ib$1@news.albasani.net>

Show all headers | View raw


Jan Burse schrieb:
>     N[sin[3.14159265358979324],18] =
>
>      -1.53735661672049712×10^-18

Oops, just reading:
http://reference.wolfram.com/mathematica/tutorial/MachinePrecisionNumbers.html

So the second N[.,.] was not necessary. Could
simply do, but the output on Wolfram alfa looks
a little bit different:

	sin[3.14159265358979324] =
		
		-1.53736... ×10^-18


Or could try the following:

	N[sin[314159265358979324 / 100000000000000000],9] =

		-1.53735662×10^-18

	N[sin[314159265358979324 / 100000000000000000],18] =

		-1.53735661672049712×10^-18

	N[sin[314159265358979324 / 100000000000000000],36] =
		
		-1.53735661672049711580283060062489418×10^-18

Note how good the high precision computation is. The lower
precision number is always the rounding of the higher
precision number.

But mechanics for high precision numbers look a little bit
more complicated to me than BigDecimal. At least if
I look at:
http://reference.wolfram.com/mathematica/tutorial/ArbitraryPrecisionNumbers.html

There is a max extra precision, which is needed in the
evaluation function N[.,.]. BigDecimal does not know about
evaluation functions. And there is some special handling
of near zero values.

Bye



Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: higher precision doubles "Nasser M. Abbasi" <nma@12000.org> - 2011-09-10 21:53 -0700
  Re: higher precision doubles Lew <lewbloch@gmail.com> - 2011-09-10 22:22 -0700
    Re: higher precision doubles "John B. Matthews" <nospam@nospam.invalid> - 2011-09-11 05:36 -0400
    Re: higher precision doubles Jan Burse <janburse@fastmail.fm> - 2011-09-11 13:29 +0200
      Re: higher precision doubles Jan Burse <janburse@fastmail.fm> - 2011-09-11 13:50 +0200
        Re: higher precision doubles Jan Burse <janburse@fastmail.fm> - 2011-09-11 14:09 +0200
  Re: higher precision doubles Jan Burse <janburse@fastmail.fm> - 2011-09-11 10:59 +0200

csiph-web