qexo-general
[Top][All Lists]
Advanced

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

RE: [Qexo-general] Problem with division


From: Seshukumar Venkata Adiraju
Subject: RE: [Qexo-general] Problem with division
Date: Thu, 27 Mar 2003 11:47:59 +0530

Thanks,

How do I round off the result to specific decimal places?

Seshu Kumar Adiraju
SETLabs, Infosys Technologies Limited
 
   In all chaos there is a cosmos,           
   in all disorder a secret order."             
                    --  Carl Jung                     
   

-----Original Message-----
From: Per Bothner [mailto:address@hidden 
Sent: Wednesday, March 26, 2003 10:56 PM
To: Seshukumar Venkata Adiraju
Cc: address@hidden
Subject: Re: [Qexo-general] Problem with division

Seshukumar Venkata Adiraju wrote:
> The Expression
> 
> (($num), "/", $den ,"=", ($num div $den))
> 
>  
> 
> evaluates to
> 
>  
> 
> 14704478/2425000=7352239/1212500

> Why is this happening?

I took some shortcurs when implementing Qexo arithmetic,
basically using Scheme arithmetic.  And Scheme provides
exact rational arithmetic.

As a work-around, you could add 0.0 or multiply by 1.0
to force the result to floating-point.
-- 
        --Per Bothner
address@hidden   http://per.bothner.com/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]