MESSAGE
DATE | 2012-02-25 |
FROM | Ruben Safir
|
SUBJECT | Re: [NYLXS - HANGOUT] Re: c++ question about decimals
|
From owner-hangout-outgoing-at-mrbrklyn.com Sat Feb 25 23:46:20 2012 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix) id 6B649100BFC; Sat, 25 Feb 2012 23:46:20 -0500 (EST) Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com Received: by www2.mrbrklyn.com (Postfix, from userid 28) id 5453F100C03; Sat, 25 Feb 2012 23:46:20 -0500 (EST) Delivered-To: hangout-at-mrbrklyn.com Received: from mail-qw0-f51.google.com (mail-qw0-f51.google.com [209.85.216.51]) by www2.mrbrklyn.com (Postfix) with ESMTP id C4F38100BFC for ; Sat, 25 Feb 2012 23:46:19 -0500 (EST) Received: by qan41 with SMTP id 41so1040505qan.17 for ; Sat, 25 Feb 2012 20:44:37 -0800 (PST) Received-SPF: pass (google.com: domain of ceo.brooklyn-at-gmail.com designates 10.229.106.23 as permitted sender) client-ip=10.229.106.23; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ceo.brooklyn-at-gmail.com designates 10.229.106.23 as permitted sender) smtp.mail=ceo.brooklyn-at-gmail.com; dkim=pass header.i=ceo.brooklyn-at-gmail.com Received: from mr.google.com ([10.229.106.23]) by 10.229.106.23 with SMTP id v23mr5195457qco.52.1330231477169 (num_hops = 1); Sat, 25 Feb 2012 20:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=R79JYonV24QucW76q3yvsu8EVS5r0CSdDFBnNy7j+nA=; b=vPQJO2H0ErY6znfxi1vSzxkWpAuwAru/cK7wXaYTCMT9Wqki6F6tMTXQz2INjZ9cHt SdEZaZfAWBTEVqorwO71Qs4UOBpdHaj4QwH6jCu7X0ykT493FvvK81AG+lqR+I13xWRF vml/I7oXNeTVeG2h60DswBNno3g8MtrX6LeyA= Received: by 10.229.106.23 with SMTP id v23mr4271380qco.52.1330231477094; Sat, 25 Feb 2012 20:44:37 -0800 (PST) Received: from [10.0.0.42] (www2.mrbrklyn.com. [96.57.23.82]) by mx.google.com with ESMTPS id ft9sm25984198qab.0.2012.02.25.20.44.36 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 20:44:36 -0800 (PST) Message-ID: <4F49B8B3.40702-at-gmail.com> Date: Sat, 25 Feb 2012 23:44:35 -0500 From: Ruben Safir User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.26) Gecko/20120124 SUSE/3.1.18 Thunderbird/3.1.18 MIME-Version: 1.0 To: hangout-at-mrbrklyn.com CC: Paul Robert Marino , hangout-at-nylxs.com Subject: Re: [NYLXS - HANGOUT] Re: c++ question about decimals References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-hangout-at-mrbrklyn.com Precedence: bulk Reply-To: hangout-at-mrbrklyn.com
On 02/24/2012 09:33 AM, Paul Robert Marino wrote: > 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 >
BTW that only gives you valid results with valid arguments to the function. If your argument is a small int, its not going to work either.
Ruben > 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.
|
|