MESSAGE
DATE | 2012-02-24 |
FROM | Paul Robert Marino
|
SUBJECT | Subject: [NYLXS - HANGOUT] Re: c++ question about decimals
|
From owner-hangout-outgoing-at-mrbrklyn.com Fri Feb 24 09:34:45 2012 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 3E967100B74; Fri, 24 Feb 2012 09:34:45 -0500 (EST) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 2D899100BE6; Fri, 24 Feb 2012 09:34:45 -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 C3925100B74 for ; Fri, 24 Feb 2012 09:34:44 -0500 (EST) Received: by obhx4 with SMTP id x4so4003441obh.34 for ; Fri, 24 Feb 2012 06:33:14 -0800 (PST) Received-SPF: pass (google.com: domain of prmarino1-at-gmail.com designates 10.182.17.100 as permitted sender) client-ip=10.182.17.100; Authentication-Results: mr.google.com; spf=pass (google.com: domain of prmarino1-at-gmail.com designates 10.182.17.100 as permitted sender) smtp.mail=prmarino1-at-gmail.com; dkim=pass header.i=prmarino1-at-gmail.com Received: from mr.google.com ([10.182.17.100]) by 10.182.17.100 with SMTP id n4mr918758obd.45.1330093994290 (num_hops = 1); Fri, 24 Feb 2012 06:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=o59NUE9XY/cEE4cE5dN0kvyF2PE1p+S1x1NZi/gRWh0=; b=u3HVs0+/9KY3Bo/EMXLkNJEvM4MK2fQHHiLLYr0XUN3nU+3qTaHhDcGya9/VubgcMZ wr+tDv4fqLOD9PEMO65TN5kMyiicBqL4KsnIASp5e5PY2vBG/s9eOlX9z1sMfcazHLN0 xNuDkEsc/QJGPc24SKgem3PcQfI/d+/QLehwg= MIME-Version: 1.0 Received: by 10.182.17.100 with SMTP id n4mr802870obd.45.1330093994210; Fri, 24 Feb 2012 06:33:14 -0800 (PST) Received: by 10.182.72.135 with HTTP; Fri, 24 Feb 2012 06:33:14 -0800 (PST) In-Reply-To: References: Date: Fri, 24 Feb 2012 09:33:14 -0500 Message-ID: Subject: [NYLXS - HANGOUT] Re: 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
actually after looking into this further what i really need to do is grab just the remainder of the result of dividing 2 numbers I think fmod is the answer im looking for
On Fri, Feb 24, 2012 at 12:48 AM, Paul Robert Marino wrote: > 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.
|
|