Summation, modulo and decimal



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. 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´s wrong with my logic?

How can I use the Sum and Mod to turn each number to 1´s and 0´s
giving a number, say, 3,14231243545546 ? I know how to do it using c++
and other languages but I want to make it using only mathematics tools.

Thank you all for the attention,

Spin.

.



Relevant Pages

  • Re: Summation, modulo and decimal
    ... >I'm trying to use the modulo (modulus, mod, %) to do the following: ... >The problem is that modulo is only def. ... It not worked because before it shift the ... >digit to the left the number is added to the previous value, so, I used ...
    (sci.math)
  • Re: [QUIZ] Modular Arithmetic (#179)
    ... def test_incompat_bases ... the Integer to a Modulo? ... raise errors for incompatible bases, ... In context with your questions above and my particular design choice: ...
    (comp.lang.ruby)
  • Re: [QUIZ] Modular Arithmetic (#179)
    ... one less than the modulus. ... we must use the appropriate congruent value modulo 24. ... While most operations will be straightforward, modular division is a ... def coerce ...
    (comp.lang.ruby)
  • Re: ISBN & undecimal counting
    ... > * each digit is replaced with a certain digit, ... > * if any two adjacent digits are transposed, the checksum changes. ... values actually sum to 0 modulo 10. ...
    (rec.puzzles)
  • Re: Modular Arithmetic (#179)
    ... Here is a simple proxy solution. ... class Modulo < BasicObject ... def method_missing ... @num other.real ...
    (comp.lang.ruby)