Re: Very strange problem with comparing floating point numbers

2012-10-01 Thread Maxim Fomin
On Monday, 1 October 2012 at 21:23:31 UTC, monarch_dodra wrote: What I was saying is that for built in types such a floats, "is" is (should be) no different from "==". But you catch something interesting: the fact that it provides different results is (IMO), a bug. Looking at it, I'd say the

Accessing CoInit [is Troubleshooting Linker error]

2012-10-01 Thread Jesse Phillips
I've made the changes needed to get past the linker error, but have run into an Access Violation when using CoInitializeEx Once again I've returned to 2.057 (without changing ole32.lib) and this will compile and run. pragma(lib, "ole32.lib"); extern(Windows) int CoInitializeEx(void*, uint dw

Re: Troubleshooting Linker error (Symbol Undefined)

2012-10-01 Thread Jesse Phillips
On Monday, 1 October 2012 at 05:04:32 UTC, Andrej Mitrovic wrote: Find oleaut32.dll in your Windows folder, and run implib on it: $ implib oleaut32.lib oleaut32.dll /s Put the import lib in the same folder as the project and change linkage to extern(C). It works for me this way. Thank you, mak

Re: Very strange problem with comparing floating point numbers

2012-10-01 Thread monarch_dodra
On Monday, 1 October 2012 at 13:08:07 UTC, Maxim Fomin wrote: 2012/10/1 monarch_dodra : On Monday, 1 October 2012 at 11:36:43 UTC, Maxim Fomin wrote: On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: As a rule of thumb, NEVER use opEqual with floating point types aniways.

Re: Using Cairo library bindings on Windows

2012-10-01 Thread Andrej Mitrovic
On 10/1/12, KillerSponge wrote: > I just tested the examples and built my own small test project > with your bindings, they are working great! Thank you so much! :) > Cool, I'm glad it works for you. Btw there is a new version of Cairo out but I think CairoD hasn't yet been updated. If that's an

Re: Troubleshooting Linker error (Symbol Undefined)

2012-10-01 Thread Richard Webb
On Monday, 1 October 2012 at 15:22:20 UTC, Jesse Phillips wrote: On Monday, 1 October 2012 at 05:04:32 UTC, Andrej Mitrovic wrote: Find oleaut32.dll in your Windows folder, and run implib on it: $ implib oleaut32.lib oleaut32.dll /s Thanks, I'll to play with this more because my first attemp

Re: Troubleshooting Linker error (Symbol Undefined)

2012-10-01 Thread Jesse Phillips
On Monday, 1 October 2012 at 05:04:32 UTC, Andrej Mitrovic wrote: Find oleaut32.dll in your Windows folder, and run implib on it: $ implib oleaut32.lib oleaut32.dll /s Thanks, I'll to play with this more because my first attempt did not resolve the issue and instead has resulted in even more

Re: Very strange problem with comparing floating point numbers

2012-10-01 Thread Maxim Fomin
2012/10/1 monarch_dodra : > On Monday, 1 October 2012 at 11:36:43 UTC, Maxim Fomin wrote: >> >> On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: >>> >>> As a rule of thumb, NEVER use opEqual with floating point types aniways. >>> You need to use some sort of comparison with leway

Re: Very strange problem with comparing floating point numbers

2012-10-01 Thread monarch_dodra
On Monday, 1 October 2012 at 11:36:43 UTC, Maxim Fomin wrote: On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: As a rule of thumb, NEVER use opEqual with floating point types aniways. You need to use some sort of comparison with leway for error, such as std.math.approxEqual.

Re: Very strange problem with comparing floating point numbers

2012-10-01 Thread Maxim Fomin
On Sunday, 30 September 2012 at 17:07:19 UTC, monarch_dodra wrote: As a rule of thumb, NEVER use opEqual with floating point types aniways. You need to use some sort of comparison with leway for error, such as std.math.approxEqual. It is possible to compare exactly floating point types by bina

Re: Is it possible to force CTFE?

2012-10-01 Thread Don Clugston
On 27/09/12 15:01, bearophile wrote: Tommi: 2) Is it possible to specialize a function based on whether or not the parameter that was passed in is a compile time constant? I am interested in this since some years. I think it's useful, but I don't know if it can be implemented. I don't remembe