summaryrefslogtreecommitdiff
path: root/files/practicum/StdNum.dcl
blob: 2c091c65b4b0283e4aa7295bdfd58b43edfa55e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
definition module StdNum

import StdClass
import StdQ				// optioneel als je StdQ geimplementeerd hebt

::  Num

instance ==     Num
instance <      Num

instance +      Num
instance -      Num
instance zero   Num

instance *      Num
instance /      Num
instance one    Num

instance abs    Num
instance sign   Num
instance ~      Num

instance toInt  Num
instance toReal Num
instance toQ    Num		// optioneel als je StdQ geimplementeerd hebt

class    fromNum a :: !Num -> a
instance fromNum Int
instance fromNum Real
instance fromNum Q		// optioneel als je StdQ geimplementeerd hebt

class    toNum   a :: !a -> Num
instance toNum   Int
instance toNum   Real
instance toNum   Q		// optioneel als je StdQ geimplementeerd hebt

instance toString Num