All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <sohalt@gmail.com>
To: netdev@vger.kernel.org
Cc: Alexander Graf <sohalt@gmail.com>
Subject: [PATCH] [iputils] Print packet loss with more precision
Date: Tue,  7 Aug 2007 15:49:50 +0200	[thread overview]
Message-ID: <11864945931233-git-send-email-sohalt@gmail.com> (raw)
In-Reply-To: <1186494590225-git-send-email-sohalt@gmail.com>

Signed-off-by: Alexander Graf <sohalt@gmail.com>
---
 ping_common.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ping_common.c b/ping_common.c
index 83be553..49acab2 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -795,9 +795,9 @@ void finish(void)
 	if (nerrors)
 		printf(", +%ld errors", nerrors);
 	if (ntransmitted) {
-		printf(", %d%% packet loss",
-		       (int) ((((long long)(ntransmitted - nreceived)) * 100) /
-			      ntransmitted));
+		printf(", %f%% packet loss",
+		       (((long long)(ntransmitted - nreceived)) * 100.0) /
+			      ntransmitted);
 		printf(", time %ldms", 1000*tv.tv_sec+tv.tv_usec/1000);
 	}
 	putchar('\n');
-- 
1.5.2.4



      reply	other threads:[~2007-08-07 13:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07 13:49 [PATCH] [iputils] Print received packets as icmp_seq Alexander Graf
2007-08-07 13:49 ` Alexander Graf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11864945931233-git-send-email-sohalt@gmail.com \
    --to=sohalt@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.