guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] build: Fix potential type error when generating human-friend


From: Steve Sprang
Subject: Re: [PATCH] build: Fix potential type error when generating human-friendly byte count strings.
Date: Wed, 9 Sep 2015 20:31:34 -0700

Sure thing. Here you go.

-Steve

On Wed, Sep 9, 2015 at 7:42 PM, Mark H Weaver <address@hidden> wrote:
Steve Sprang <address@hidden> writes:

> This is a follow up tweak to my previous "progress bar" patch. With a
> really slow throughput it's possible to get fractional sub-KiB byte
> counts, so I added some additional number massaging.

Sounds good!  Looks good to me except for a few minor nits on this
auxiliary procedure:

> +(define (number->integer n)
> +  "Given an arbitrary number N, round it and return the exact result."
> +  (inexact->exact (round n)))

How about calling it "nearest-exact-integer"?  Also, it makes sense only
for real numbers, not arbitrary numbers, and the variable name N is
conventionally used to denote natural numbers, and X for real numbers.

So, how about naming the argument 'x', and using something closer to the
following docstring:

  "Given a real number X, return the nearest exact integer, with ties
going to the nearest exact even integer."

Otherwise, looks good to me.  Can you send an updated patch?

      Mark

Attachment: type-fix2.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]