comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Ada.Numerics, Accuracy of trigonometric functions
Date: Fri, 07 Oct 2016 10:52:49 -0400
Date: 2016-10-07T10:52:49-04:00	[thread overview]
Message-ID: <g8dfvb5eln7isqv9k9ihjp0ts5b28o1vhn@4ax.com> (raw)
In-Reply-To: nt7sgs$1a06$1@gioia.aioe.org

On Fri, 7 Oct 2016 12:13:48 +0200, Markus Schöpflin <no.spam@spam.spam>
declaimed the following:


>X = 4294967296.00000; COS(X) =  1.00000      <-- WHAT?

	That kind of surprises me...  Not the cos() result, but the input X

	Short float should only have around 23-24 bits of significance in the
mantissa -- enough for around 7 decimal digits. Yet you are seeing the full
UNSIGNED 32-bit integer value with a stack of fractional zeros tacked on.

	I'm tempted to think the compiler, not the run-time, is computing the
2^32 as a universal (or whatever the preferred term is)  constant using the
smallest data type that holds the full value.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


  parent reply	other threads:[~2016-10-07 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 10:13 Ada.Numerics, Accuracy of trigonometric functions Markus Schöpflin
2016-10-07 10:23 ` Markus Schöpflin
2016-10-07 10:23 ` Brian Drummond
2016-10-07 10:40   ` Markus Schöpflin
2016-10-07 14:52 ` Dennis Lee Bieber [this message]
2016-10-07 15:19   ` Markus Schöpflin
2016-10-07 22:15     ` Dennis Lee Bieber
2016-10-07 16:38 ` Jeffrey R. Carter
2016-10-10  7:44   ` Markus Schöpflin
2016-10-22 22:38 ` Robert Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox