"Shifting" floating point numbers
- From: woessner@xxxxxxxxx
- Date: 21 Mar 2006 10:45:59 -0800
Does anyone know of a fast way to multiply floating point numbers by
powers of two? Conceptually, all you need to do is add to the
mantissa. But can I write C code (or x86 assembly) to accomplish this
without a full-blown multiply?
For example, I'd like to be able to do the following very quickly:
double x;
double y;
x = 42.13;
y = (1 << 9) * x;
Thanks in advance,
Bill
.
- Follow-Ups:
- Re: "Shifting" floating point numbers
- From: Robin Haigh
- Re: "Shifting" floating point numbers
- From: *** T. Winter
- Re: "Shifting" floating point numbers
- From: Jordan Abel
- Re: "Shifting" floating point numbers
- From: Keith Thompson
- Re: "Shifting" floating point numbers
- From: Pierre Maurette
- Re: "Shifting" floating point numbers
- From: Eric Sosman
- Re: "Shifting" floating point numbers
- From: Skarmander
- Re: "Shifting" floating point numbers
- From: santosh
- Re: "Shifting" floating point numbers
- Prev by Date: Re: Function Protoytpe Identifier....
- Next by Date: Re: Benchmarking multiplications and additions
- Previous by thread: help me atleast now
- Next by thread: Re: "Shifting" floating point numbers
- Index(es):