Float vs. Integer

Sam Rawlins sam.rawlins at gmail.com
Fri Jan 4 23:32:18 CET 2013


On Fri, Jan 4, 2013 at 12:12 PM, Albert Redditt <albert_redditt at yahoo.com>wrote:

> Hello;
>
> When doing long math on paper , you always forget about the decimal until
> the end ...
>
> The only time you need to consider the decimal prior to computation is for
> L / R padding in ADD / SUB  , and left padding in SQRT
> Basically all math functions are integer..
>
>
> Why does GMP use separate functions for int and float?
>

Hello Albert,

I suspect your question is actually "Why does GMP use separate functions
for integers and floats?" (GMP integers being different from int). As a
long-winded answer, please read "What Every Computer Scientist Should Know
About Floating-Point Arithmetic" (
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html). Integers
and floating point numbers are represented quite differently from each
other.


>
> Just wondering..
>
> albert_redditt at yahoo.com
> _______________________________________________
> gmp-bugs mailing list
> gmp-bugs at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-bugs
>



-- 
Sam Rawlins


More information about the gmp-bugs mailing list