Re: Summation, modulo and decimal
- From: magidin@xxxxxxxxxxxxxxxxx (Arturo Magidin)
- Date: Mon, 23 Jan 2006 21:43:05 +0000 (UTC)
In article <1138051905.570033.233690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<spin9@xxxxxxxxxxxx> wrote:
>Hello.
>
>I'm trying to use the modulo (modulus, mod, %) to do the following:
>
>(1) 0,147536 -> (2) 0.101110
>
>The problem is that modulo is only def. to Integers.
Indeed. What is it you expect the answer to be? Are you looking for
the unique real number m such that
0.147536 = p*0.101110 + m
such that p is an integer and 0<= m < 0.101110 ?
> So, I used the
>sigma/summation to shift the decimal point to the left (multiply by
>10^k) to get each digit. It not worked because before it shift the
>digit to the left the number is added to the previous value, so, I used
> in the formula another "trick" (-1)^k , so the number stay the same
>after k even increments. When I try to use it all together the (-1)^k
>and the 10^k "cancel each other" and I get the same initial value.
>What=B4s wrong with my logic?
Yikes. What is it you are doing, explicitly?
The easiest way to do what you want, if what I think you want is
indeed what you want, is to simply multiply both numbers by 10^6, do
the modulus, and then divide the result by 10^6. That is, do 147536
mod 101110, which is 46426; then divide the result by 10^6 to get
0.046426
>How can I use the Sum and Mod to turn each number to 1=B4s and 0=B4s
>giving a number, say, 3,14231243545546 ?
Huh?
--
======================================================================
"It's not denial. I'm just very selective about
what I accept as reality."
--- Calvin ("Calvin and Hobbes")
======================================================================
Arturo Magidin
magidin@xxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Summation, modulo and decimal
- From: B. Spin
- Re: Summation, modulo and decimal
- References:
- Summation, modulo and decimal
- From: spin9
- Summation, modulo and decimal
- Prev by Date: Summation, modulo and decimal
- Next by Date: Re: Cantorian pseudomathematics
- Previous by thread: Summation, modulo and decimal
- Next by thread: Re: Summation, modulo and decimal
- Index(es):
Relevant Pages
|