From: bdsatish
Subject: How does (mod a b) work ?
Date: 
Message-ID: <d1fbf135-1374-4121-a559-d05eb9a14a2d@s13g2000prd.googlegroups.com>
Hi all,

I'm a newbie to lisp.

Technically, the value of (mod a 1.0) is equal to the fractional part
of 'a' (assuming 'a' is a floating point value).

[prompt]> (mod 1.25 1.0)
 [ans] 0.25

But why does the following fail ?

[prompt]> (mod  1.89232E9 1.0)
0.0

The fractional part must be 0.892... but I get zero. Why ?

From: Jason
Subject: Re: How does (mod a b) work ?
Date: 
Message-ID: <2bf5a6c6-c1cb-442f-a527-a18175540752@x19g2000prg.googlegroups.com>
On Apr 10, 8:51 pm, bdsatish <········@gmail.com> wrote:
> Hi all,
>
> I'm a newbie to lisp.
>
> Technically, the value of (mod a 1.0) is equal to the fractional part
> of 'a' (assuming 'a' is a floating point value).
>
> [prompt]> (mod 1.25 1.0)
>  [ans] 0.25
>
> But why does the following fail ?
>
> [prompt]> (mod  1.89232E9 1.0)
> 0.0
>
> The fractional part must be 0.892... but I get zero. Why ?

Notice the "E9".
From: John Thingstad
Subject: Re: How does (mod a b) work ?
Date: 
Message-ID: <op.t9fmronput4oq5@pandora.alfanett.no>
P� Fri, 11 Apr 2008 05:51:41 +0200, skrev bdsatish <········@gmail.com>:

> Hi all,
>
> I'm a newbie to lisp.
>
> Technically, the value of (mod a 1.0) is equal to the fractional part
> of 'a' (assuming 'a' is a floating point value).
>
> [prompt]> (mod 1.25 1.0)
>  [ans] 0.25
>
> But why does the following fail ?
>
> [prompt]> (mod  1.89232E9 1.0)
> 0.0
>
> The fractional part must be 0.892... but I get zero. Why ?

Did you notice the E9 bit? thats * 10^9

(mod 1892320000.0 1.0) which is 0.0

--------------
John Thingstad