[futurebasic] Re: [FB] FB Help Error - FYI

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2010 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Sat, 30 Jan 2010 12:16:54 +1300
Jay Reeve wrote:

> FB has always allowed for bit-shifting real numbers whereby they would be multiplied or divided by the appropriate (and possibly non-integer) power of 2. In FB4,
> print pi << 3  ..... Produces.....  25.1327412287
> and
> print pi << pi ..... Produces.....  27.7244855096
> 
> Hence the reference to real numbers in the explanation. Is that no longer the case? Should it be?

Whether you regard this feature of old FB as a lovable idiosyncrasy or a freakish abuse of the shift operator, FB5 firmly rejects it:
•• Expression types incompatible with comparison or shift operator


> Also, I think a bit shift greater than the width of the first operand is not (and should not be) undefined.

'Undefined' results are certainly not a glittering jewel in the C language family. They are a regrettable fact of life.
<http://en.wikipedia.org/wiki/Undefined_behavior>

Robert P.