X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:mime-version :content-transfer-encoding; q=dns; s=default; b=ZvkmU79JaHh2LmXP Qwa/G2/RjR/mTO9zlqXwYo9H4iYhcAGSj2+5Pj4+E/8TUmYe3rZKGPz6swD/wDso WDnwjRircsJ3d0RmM1+8h0QBK462SbY+M5WaoKqTbsyGENqhGoY1bO84eZ3Z7cd5 3JN9sNCfYbULgh/dIOFm6abDxQA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:mime-version :content-transfer-encoding; s=default; bh=lOAawS4ZH4CjXrBDUqTPsZ +uUtI=; b=imuQD9s3DZPrL83VStptcJskwt7j9S9jN4zpVQEAjwuYwBh++TY+B9 iSwUNdJDBDbqILi6qYfQL02mFnVVPIVVkvqcsgIbhD+4dEJodPpzdeuR1F2u4MIQ 0a+xuHzPJb60PMHCOsEVfTIt9WCyQLGU2c07EnCpE0ScLQQy6TYlA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=powers, Tel, tel, commercial X-HELO: mga05.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: "Soegtrop, Michael" To: "dank AT kegel DOT com" , "cygwin AT cygwin DOT com" Subject: RE: Floating point exception in strtod() Date: Sun, 8 Apr 2018 12:57:19 +0000 Message-ID: <0F7D3B1B3C4B894D824F5B822E3E5A177861A345@IRSMSX102.ger.corp.intel.com> References: In-Reply-To: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjFkNjYxYzctN2NkMC00ZTBhLWJlNGUtYzIyMTJmNzgxZDU2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJDaVp0UStzNnNPUHhWbXRVekRmNEpXYTJJY2krZUZ1MGlRWnM3T3JaOG1HUUZXTmxTWHNDSnhVXC94bFg3aDRLUSJ9 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w38CvXII004531 > Probably doesn't fit precisely into a double. Does strtold behave > better? actually both numbers can be represented exactly as IEEE double. In Maxima: (%i1) factor(121645100408832000); (%o1) 2^16*3^8*5^3*7^2*11*13*17*19 (%i2) float(log(3^8*5^3*7^2*11*13*17*19)/log(2)); (%o2) 40.75545582601886 (%i3) factor(221645100408832000); (%o3) 2^16*5^3*31*41*1361*15641 (%i4) float(log(5^3*31*41*1361*15641)/log(2)); (%o4) 41.62102908434535 So the first number has 41 bits and the second 42 after removing powers of 2. The significand size of a double is 53 bits (including the implicit 1). Best regards, Michael Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple