digitalmars.D.learn - int to bit
- Ant (4/4) May 12 2005 cannot implicitly convert expression ...... of type int to bit
- Derek Parnell (7/12) May 12 2005 No, I don't think so.
- Ant (17/31) May 12 2005 rebooted to linux.
- Peter Mackay (9/11) May 13 2005 I think because it's faster. Otherwise the machine, which deals with int...
-
Stewart Gordon
(8/16)
May 13 2005
- Jarrett Billingsley (3/5) May 13 2005 bit.sizeof is 1, so it's probably represented as a byte.
cannot implicitly convert expression ...... of type int to bit is this new? Window 2000, dmd 0.123 Ant
May 12 2005
On Fri, 13 May 2005 03:50:08 +0000 (UTC), Ant wrote:cannot implicitly convert expression ...... of type int to bit is this new? Window 2000, dmd 0.123No, I don't think so. You can't implicitly convert float to int either. -- Derek Melbourne, Australia 13/05/2005 2:06:42 PM
May 12 2005
Derek Parnell wrote:On Fri, 13 May 2005 03:50:08 +0000 (UTC), Ant wrote:rebooted to linux. it's ok for dmd 0.121 linux downloading dmd 0.123...installing...ok still passes on linux dmd 0.123. from phobos: class Object { void print(); char[] toString(); uint toHash(); int opCmp(Object o); int opEquals(Object o); } why does opEquals return an int? (all my "int to bit" were from "==") Antcannot implicitly convert expression ...... of type int to bit is this new? Window 2000, dmd 0.123No, I don't think so. You can't implicitly convert float to int either.
May 12 2005
Hello,why does opEquals return an int?I think because it's faster. Otherwise the machine, which deals with int sizes well (typically because they're native word sized), would have to convert between int and bits all the time. The int vs bit vs bool argument has been bashed out on the group a lot I suspect. It's not how I'd like it either, but I think it's just 'how it is'.(all my "int to bit" were from "==")I get this too, since I usually have functions return a bool for my own readability, and have to add a cast manually. Pete
May 13 2005
Peter Mackay wrote:Hello,<snip> But isn't a single bit (as opposed to a bit array) represented internally as an int anyway? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.why does opEquals return an int?I think because it's faster. Otherwise the machine, which deals with int sizes well (typically because they're native word sized), would have to convert between int and bits all the time.
May 13 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:d62k80$2fn0$1 digitaldaemon.com...But isn't a single bit (as opposed to a bit array) represented internally as an int anyway?bit.sizeof is 1, so it's probably represented as a byte.
May 13 2005