Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30347 invoked by uid 1010); 23 Aug 2007 15:28:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30331 invoked from network); 23 Aug 2007 15:28:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2007 15:28:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=zoe.slattery@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zoe.slattery@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 64.233.182.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: zoe.slattery@googlemail.com X-Host-Fingerprint: 64.233.182.191 nf-out-0910.google.com Received: from [64.233.182.191] ([64.233.182.191:18088] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/05-32871-297ADC64 for ; Thu, 23 Aug 2007 11:28:21 -0400 Received: by nf-out-0910.google.com with SMTP id e27so392577nfd for ; Thu, 23 Aug 2007 08:28:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=TjA7lB0LHQxgwwE17/rDtWz0+wpg3BebppT3gdIdsfsn6fdgn2PaWyO7/mQrxTBa6I2Q2d901D4QoRmrcLBupsgR7zLZGeQbDIu+470eGd6Uftnj+wRYhiDpXGFNldIwHdPnPeSOKIkzNkvOkijJbqo4wGgCBIfCcgrPPhObt2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=jSGKhW25F9cxU8YlD7mRU269MIyRZAlgXs7de8rU8ACdxTpmnaeyB9uFD2aeaqYOxscuBaLILv544NLy1TKM++JakT2IhLLu1lYJd8iEAg/rd+uwyWcoTwIIxSgc7rbDTj5yGyYyjLCBHAfe3uOZ46IRb8e+IxzM7QqfmD0JwTg= Received: by 10.78.37.7 with SMTP id k7mr1271092huk.1187882894498; Thu, 23 Aug 2007 08:28:14 -0700 (PDT) Received: from ?9.20.187.201? ( [195.212.29.75]) by mx.google.com with ESMTPS id 6sm6395293nfv.2007.08.23.08.28.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Aug 2007 08:28:11 -0700 (PDT) Message-ID: <46CDA789.3080109@googlemail.com> Date: Thu, 23 Aug 2007 16:28:09 +0100 User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Testing math functions From: zoe.slattery@googlemail.com (Zoe Slattery) Hi - I've writing a few tests for the math extension and have a question about floating point precision. Here's a small example: --TEST-- Test return type and value for expected input sin() --INI-- precision = 14 --FILE-- --EXPECT-- sin 360 = float(-2.4492127076448E-16) Is it right to test for an exact number in this way? I was slightly suprised that I got the same number from Windows and Linux (maybe I shouldn't be). If not, I could write the test above to check that sin 360 is zero plus/minus some small number - but how small? Zoe Slattery IBM