Skip Menu |

This queue is for tickets about the Number-Bytes-Human CPAN distribution.

Report information
The Basics
Id: 118814
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Number-Bytes-Human

People
Owner: dagobert [...] cpan.org
Requestors: nassarmu [...] umn.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.10



Subject: improper handling of floating point inputs
Date: Thu, 17 Nov 2016 10:04:32 -0600
To: bug-Number-Bytes-Human [...] rt.cpan.org
From: Munir Nassar <nassarmu [...] umn.edu>
While writing a tool to deal with user quotas i ran into an issue with Number::Bytes::Human, the parser does not properly handle floating point numbers: parse(1G)= 1073741824 parse(1.5G)= 1078984704 parse(1.50G)= 1126170624 parse(1.500G)= 1598029824 parse(1.5000G)= 6316621824 tested on ubuntu 14.04.05 with libnumber-bytes-human-perl version 0.09-1. I do not have access to non-debian based distros but i suspect that this issue is not distro specific. expected outcome: the output for 1.5G, 1.50G, 1.500G 1.5000G should be the same. attached is my test script to show the problem -- Munir Nassar <nassarmu@umn.edu> Infrastructure Engineer, College of Science and Engineering University of Minnesota Key fingerprint = B033 3852 64F1 C8EF 9626 2C2F 7900 EBB3 2D44 A694

Message body is not shown because sender requested not to inline it.

Hi Nassar, Am Do 17. Nov 2016, 11:05:11, nassarmu@umn.edu schrieb: Show quoted text
> While writing a tool to deal with user quotas i ran into an issue with > Number::Bytes::Human, the parser does not properly handle floating point > numbers:
This is a duplicate for Bug #114296 and the fix has already been released as version 0.10. Nonetheless I added your invocations as additional test cases which will go into a future release: https://github.com/dago/Number-Bytes-Human/commit/093455bd969b49f10ddf3250022535c0331b4de3