Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2558

Re: integer Vs floating point efficiency?

From BGB <cr88192@hotmail.com>
Newsgroups comp.programming
Subject Re: integer Vs floating point efficiency?
Date 2012-12-01 16:49 -0600
Organization albasani.net
Message-ID <k9e1na$pl3$1@news.albasani.net> (permalink)
References <k9ctp5$56j$1@dont-email.me>

Show all headers | View raw


On 12/1/2012 6:39 AM, Rui Maciel wrote:
> Is there any information on the relative efficiency of modern CPUs with
> regards to algebraic operations on integer and floating point data types?
>
> If there is, where can I get my hands on it?
>

informal results are that integer is slightly faster, especially when 
working with integer data (because integer<->float conversions are 
expensive).

the difference at this point is "modest" though, as both seem to be more 
at the whim of "how quickly the CPU can perform operations".


the main advantage of integer though is that it is possible to more 
precisely control round-off behavior (allowing for more determinism), 
which, combined with it not suffering from conversion-performance 
issues, makes integer math better suited to things like signal 
processing and A/V codecs (which are typically, mostly, integer and 
fixed-point math).

there are downsides to fixed-point though (vs floats), namely that it is 
more awkward than floating-point math (since manual handling of rounding 
and lots of shifts are needed), if used naively may be actually slower 
than floats, and typically has a more limited value-range (the number of 
bits above and below the decimal point may become an important factor in 
the operation of an algorithm).


>
> Thanks in advance,
> Rui Maciel
>

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

integer Vs floating point efficiency? Rui Maciel <rui.maciel@gmail.com> - 2012-12-01 12:39 +0000
  integer Vs floating point efficiency? Rui Maciel <rui.maciel@gmail.com> - 2012-12-01 12:41 +0000
    Re: integer Vs floating point efficiency? Herman Rubin <hrubin@skew.stat.purdue.edu> - 2012-12-02 23:10 +0000
      Re: integer Vs floating point efficiency? Robin Vowels <robin.vowels@gmail.com> - 2012-12-02 16:36 -0800
    Re: integer Vs floating point efficiency? Rui Maciel <rui.maciel@gmail.com> - 2012-12-03 10:03 +0000
  Re: integer Vs floating point efficiency? BGB <cr88192@hotmail.com> - 2012-12-01 16:49 -0600
  Re: integer Vs floating point efficiency? "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-12-03 10:22 +0000

csiph-web