Re: Floating point in the type system

2015-09-12 Thread Robert via Digitalmars-d
On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote: Hi all, I came across this example, and wondered what your thoughts on it are: It seems a little unusual to me. Robert For what it's worth, I was investigating this initially as a discussion about adding type-level values

Floating point in the type system

2015-09-12 Thread Robert via Digitalmars-d
Hi all, I came across this example, and wondered what your thoughts on it are: ``` void main(string[] args) { struct Foo(float f) { alias VAL = f; float getF() { return f; } } Foo!(float.nan) f; Foo!(float.nan) f2; // This will fail

Re: Floating point in the type system

2015-09-12 Thread Robert via Digitalmars-d
On Saturday, 12 September 2015 at 15:49:23 UTC, Atila Neves wrote: On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote: Hi all, I came across this example, and wondered what your thoughts on it are: ``` void main(string[] args) { struct Foo(float f) { alias VAL = f;