4 module rt.typeinfo.ti_cdouble;
6 class TypeInfo_r : TypeInfo
8 override string toString() { return "cdouble"; }
10 override hash_t getHash(in void* p)
12 return (cast(uint *)p)[0] + (cast(uint *)p)[1] +
13 (cast(uint *)p)[2] + (cast(uint *)p)[3];
16 static int _equals(cdouble f1, cdouble f2)
21 static int _compare(cdouble f1, cdouble f2)
26 else if (f1.re > f2.re)
28 else if (f1.im < f2.im)
30 else if (f1.im > f2.im)
37 override equals_t equals(in void* p1, in void* p2)
39 return _equals(*cast(cdouble *)p1, *cast(cdouble *)p2);
42 override int compare(in void* p1, in void* p2)
44 return _compare(*cast(cdouble *)p1, *cast(cdouble *)p2);
47 override size_t tsize()
49 return cdouble.sizeof;
52 override void swap(void *p1, void *p2)
56 t = *cast(cdouble *)p1;
57 *cast(cdouble *)p1 = *cast(cdouble *)p2;
58 *cast(cdouble *)p2 = t;
61 override void[] init()
64 return (cast(cdouble *)&r)[0 .. 1];