Dies ist eine statische Kopie unseres alten Forums. Es sind keine Interaktionen möglich.
This is a static copy of our old forum. Interactions are not possible.

matthiass

Trainee

  • "matthiass" is male
  • "matthiass" started this thread

Posts: 117

Date of registration: Sep 30th 2009

1

Sunday, November 15th 2009, 3:06pm

Scheme - Aufgabenblatt 5 - Aufgabe 4

Hi!

Bei Aufgabe 4a im aktuellen Aufgabenblatt soll eine Prozedur 'add-without-carry' (Addieren ohne Übertrag) für Zahlen im Dezimalsystem geschrieben werden. Als Beispiel ist dort der folgende Prozeduraufruf angegeben:

Source code

1
(add-without-carry ’(1) ’(9)) --> ’(10)


Ist das nicht falsch? Die Addition sollte ohne Carry doch 0 liefern, oder?

Kann mir da mal jmd. auf die Sprünge helfen?

Danke!

  • "Schokoholic" is male

Posts: 2,518

Date of registration: Oct 4th 2006

Location: Hannover

Occupation: Haarspaltung

2

Sunday, November 15th 2009, 3:36pm

Nein, das wäre Addition modulo 10.

Hier ist gemeint, dass die Stellen deiner Zahl auch Werte größer 10 9 annehmen können, was ja sonst im Dezimalsystem nicht geht. Ein besseres Beispiel wäre vielleicht folgendes.

Source code

1
(add-without-carry ’(3 6 2 9) ’(9 7 7)) --> ’(3 15 9 16)


Alle Angaben wie immer ohne Gewähr. ;)

This post has been edited 1 times, last edit by "Schokoholic" (Nov 15th 2009, 3:42pm)


matthiass

Trainee

  • "matthiass" is male
  • "matthiass" started this thread

Posts: 117

Date of registration: Sep 30th 2009

3

Sunday, November 15th 2009, 3:39pm

Ah, ok.

Quoted

was ja sonst im Dezimalsystem nicht geht.
Genau das war mein Problem damit.

Vielen Dank für deine Antwort und ein schönes Wochenende noch.