Monday, February 25, 2008

class notes from today

some prolog:

father (terach, avraham).
father (avraham, yitzchak).
father (avraham, yishmael).

brother (A, B) :- father(C, A), father (C, B).

?- brother (yitzchak, yishmael)
True

?- brother (yitzchak, Z)
yishmael

floating point:
_______________
sign bit
exponent
fraction

decimal
_____________
part before decimal pt.
part after decimal pt.
1060 = 10.60


integers
______________
sign magnitude notation
two's complement
one's complement

descriptors for:

static length string

--------------
string
length
address
_________________

limited dynamic length string

_-________________________
limited dynamic string
maximum length
current length
address
___________________________

enum temperature { hot, cold, freezing };

enum proximity { near = 6, cold = 7, freezing =8};
proximity::cold

No comments: