On Tue, 2007-05-01 at 11:56 -0700, Erick Tryzelaar wrote: > I was reading through the lexer and I noticed that we don't support > imaginary and complex literals like "1.0d + 0.5di". Would this be > something useful to have? We'd possibly would have to write our own > imaginary and complex types if there isn't a c++ version of them > available, unless you guys think it's standard enough to depend on. This > could be another handy thing for 1.1.4.
There are a couple of issues. First, C++ has complex and so does Felix. Unfortunately C99 also has complex, and it's a different type altogether. Second, engineers use 'j', mathematicians use 'i'. If we go up to Quaternions, they use i,j,k. You may have used quaternions in high school physics, you write: 10 + 3i + 4j + 5k to give an event location: 10 seconds, 3,4,5 metres x,y,height coordinates. They're cool because the tensor product needed for things like angular momentum 'just drops out' from the axioms like i * i = -1 etc. Otherwise, yes you could do it .. of course 'i' is nasty because it also means 'integer': 10i // int 10.1i // imaginary which leaves gaussian integers in the cold :) -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language