MESSAGE
DATE | 2012-02-24 |
FROM | Paul Robert Marino
|
SUBJECT | Subject: [NYLXS - HANGOUT] c++ question about decimals
|
From owner-hangout-outgoing-at-mrbrklyn.com Fri Feb 24 00:50:10 2012 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 6754AFE16B; Fri, 24 Feb 2012 00:50:10 -0500 (EST) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 585FA100BB4; Fri, 24 Feb 2012 00:50:10 -0500 (EST) Delivered-To: hangout-at-nylxs.com Received: from mail-tul01m020-f175.google.com (mail-tul01m020-f175.google.com [209.85.214.175]) by www2.mrbrklyn.com (Postfix) with ESMTP id C44C7FE16B for ; Fri, 24 Feb 2012 00:50:09 -0500 (EST) Received: by obhx4 with SMTP id x4so3403580obh.34 for ; Thu, 23 Feb 2012 21:48:42 -0800 (PST) Received-SPF: pass (google.com: domain of prmarino1-at-gmail.com designates 10.60.26.166 as permitted sender) client-ip=10.60.26.166; Authentication-Results: mr.google.com; spf=pass (google.com: domain of prmarino1-at-gmail.com designates 10.60.26.166 as permitted sender) smtp.mail=prmarino1-at-gmail.com; dkim=pass header.i=prmarino1-at-gmail.com Received: from mr.google.com ([10.60.26.166]) by 10.60.26.166 with SMTP id m6mr301879oeg.45.1330062522989 (num_hops = 1); Thu, 23 Feb 2012 21:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ZUoQfKQqvlpX8zozwiw9vRzGjh1F+0MQxL9go+LDe9o=; b=A6gfexx823QU7SiSu7i8VmJ2vgs60W4wWlhSdYeNlSTknx6aBlDDcBCZkyg/IVIZlf Xxs0TNOcy6Mc19gJomk8kbdsUuyVIBU8hoHn03rAo29R2OzpkzmZGaQT3guJnZdK002v ncyjD+5cDNLtn8zfBFEn0AXWEQLOwJo0rNzzY= MIME-Version: 1.0 Received: by 10.60.26.166 with SMTP id m6mr265692oeg.45.1330062522936; Thu, 23 Feb 2012 21:48:42 -0800 (PST) Received: by 10.182.72.135 with HTTP; Thu, 23 Feb 2012 21:48:42 -0800 (PST) Date: Fri, 24 Feb 2012 00:48:42 -0500 Message-ID: Subject: [NYLXS - HANGOUT] c++ question about decimals From: Paul Robert Marino To: hangout-at-nylxs.com Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
my C programmings a little rusty and i could use some help im working on a patch for keepalived i have to modify a portion of the code that type casts several variables as a unsigned long however I need to change it to an equivalent the will store it with a decimal with 2 points of precision, and if possible wont change how other parts of the code use the same functions with whole numbers does any one have any suggestions.
by the way in case any one is wondering im working on implementing centisecond (hundredth) of a second intervals for VRRP per the RFC for VRRPv3 http://tools.ietf.org/html/rfc5798 so far its going well but there are a few points in the code that are doing crazy things like setting a sleep timer to 0 seconds which is what I'm trying to fix now. that being said the rest of the patch works great i was able to cut my interface failover times in nearly down from 8 to less than 3 seconds total.
|
|