From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id AA03719C026F for ; Fri, 20 Nov 2015 04:31:46 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id E3666B5D847 for ; Fri, 20 Nov 2015 05:02:35 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id D519018CC7B9 for ; Fri, 20 Nov 2015 05:02:35 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7DB5B120468; Fri, 20 Nov 2015 05:02:33 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id C7AF4120443 for ; Fri, 20 Nov 2015 05:02:30 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=wxNNQvaNm5fSeG/UVlwmzqeTjNQ=; b=b2/eyhfx+qopflxTYY oiijA6iSUIzp+yfqve0ax3j/B7DdDSW4hccmdSMUpeoleGqkClnSQhf4E4C5vtih C4xpLM3AStervNbdKi1Vz/u0uiGRPH18kPl0ayw4Dk9JqTOeZKqT7+w9+EDWvS9J b1bpQ3otAm1JMQ8aXBk+Nb+Ck= Received: by filter0839p1mdw1.sendgrid.net with SMTP id filter0839p1mdw1.12740.564E2ABA8F 2015-11-19 20:02:02.773094159 +0000 UTC Received: from herokuapp.com (ec2-50-17-29-76.compute-1.amazonaws.com [50.17.29.76]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id 8sBfS50US3W7WBz2EqbxWQ for ; Thu, 19 Nov 2015 20:02:02.546 +0000 (UTC) Date: Thu, 19 Nov 2015 20:02:02 +0000 From: niroyb@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 46254 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11716 X-Redmine-Issue-Author: niroyb X-Redmine-Sender: niroyb X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4OJO1qWtCE7R5JvgR6gtB9aXEKmf8xDWsJHn Oa8yDJh+/DvkEJHbwl/RYokMfJZUGT/XykkjGRn1nWoy2JXZz6oClz/lps/tcozEFbUM5Ab2I4tZhr /5pqI4WnN15wPKD4WX6pJ7+CbubT+eku+NyD X-SendGrid-Contentd-ID: {"test_id":"1447963325"} X-ML-Name: ruby-core X-Mail-Count: 71589 Subject: [ruby-core:71589] [Ruby trunk - Bug #11716] [Open] Truncation error in Time xmlschema with fraction_digits. X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11716 has been reported by Nick R. ---------------------------------------- Bug #11716: Truncation error in Time xmlschema with fraction_digits. https://bugs.ruby-lang.org/issues/11716 * Author: Nick R * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- It looks like xmlschema with the fraction_digits parameter truncates the fractional second part. Sometimes it truncates too much. ex : 1447961542.26 with 2 fraction digits gives 1447961542.25 instead of 1447961542.26 Could be due to floating point representation. But tests seem to indicate otherwise. `$ irb $ require 'time' => true $ Time.at(1447961542.26).xmlschema(2) => "2015-11-19T11:32:22.25-08:00" $ Time.at(1447961542.269).xmlschema(2) => "2015-11-19T11:32:22.26-08:00" $ Time.at(1447961542.259).xmlschema(2) => "2015-11-19T11:32:22.25-08:00" $ Time.at(1447961542.25).xmlschema(2) => "2015-11-19T11:32:22.25-08:00" $ 1447961542.26*100.floor => 144796154226.0 ` -- https://bugs.ruby-lang.org/