zurück   Startseite   Blog Buchregal Buchregal, eBooks Twitter E-Mail

 

Vigesimal Numbers

Pre-Columbian Maya civilization - there numbers

Maya numerals are a vigesimal, base-twenty based, numeral system.The numerals are made up of three symbols; zero as shell shape, one as dot  and five as bar. For example, eleven is written as one dot above two horizontal lines stacked upon each other.

.
=


Vigesimal system: 1, 20, 400, 8000 and so on.


; -assissting functions --------------------------------------------------------------

(define (maxDIV myValue myBase myStaticBase)
  (if (>= myValue (* myBase myStaticBase))
      (maxDIV myValue (* myBase myStaticBase) myStaticBase)
      myBase
      )
)


(define (DIV myValue1 myValue2)    (- myValue1 (remainder myValue1 myValue2)))

(define (aoanDIV myValue1 myValue2) (/ (DIV myValue1 myValue2) myValue2))


(define (baseSplitt myValue myBase myStaticBase)

    (if (> myValue myBase)

        (begin
          (display "; ")(display myBase) (display ": ") (display (aoanDIV myValue myBase)) (newline)
                (baseSplitt (- myValue (DIV myValue myBase)) (/ myBase mystaticbase) myStaticBase)
        )
        
        
        (begin
                (display "; ")   
            (display "1: ")
            (display myValue)
            0
        )
))

(define startmaxBase 0)

(define (bconverter myValue myStaticBase)
  (set! startmaxBase (maxDIV myValue myStaticBase myStaticBase))
  (baseSplitt myValue startmaxBase myStaticBase))


; -begin------------------------------------------------------------------------------

(bconverter 168402 20)
; 160000: 1
; 8000: 1
; 400: 1
; 1: 2
;Value: 0

 

 

25. März 2019     | mit scheme | scheme | lisp | old data

zurück

 

     

Startseite | Impressum | Datenschutz