Re: Integer arithmetic vs double precision arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shriramana Sharma wrote:

> I am trying to work out whether to use an integer or a double for my internal 
> storage variable of a class meant to store a time.
> 
> Qt uses an unsigned integer with millisecond being the best precision, but I 
> am wondering, why I should lose the extra digits of precision that I could 
> get if I used a double.
> 
> Is there a marked increase in computing speed if integer arithmetic is used 
> compared to double precision?

It depends upon the architecture, but a double could be a lot slower
than an int.

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux