----boundary-LibPST-iamunique-439335255_-_-
Content-type: text/plain
Hi Andrew,
I would say that the equivalent in CP for the C statement:
return( (double) y / (unsigned long) 0xffffffff);
Would be (assuming y is REAL):
RETURN y / 0FFFFFFFFL;
Note the L suffix to indicate that the constant should be interpreted as a
LONGINT.
Chris Burrows
CFB Software
http://www.cfbsoftware.com
> -----Original Message-----
> From: blackbox{([at]})nowhere.xy> Behalf Of Andrew Thomas
> Sent: Tuesday, 29 March 2005 5:15 PM
> To: BlackBox Mailing List
> Subject: [BlackBox] - Bit operations in Component Pascal
>
> >
> > 2. What is the specific problem you have with the return statement?
> >
>
> Hi Chris,
>
> the problem is that the divide is by MAX(unsigned integer)
>
> Andrew
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-439335255_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpIEFuZHJldyxccGFyDQpccGFyDQpJIHdvdWxk
IHNheSB0aGF0IHRoZSBlcXVpdmFsZW50IGluIENQIGZvciB0aGUgQyBzdGF0ZW1lbnQ6XHBhcg0K
XHBhcg0KICByZXR1cm4oIChkb3VibGUpIHkgLyAodW5zaWduZWQgbG9uZykgMHhmZmZmZmZmZik7
XHBhcg0KXHBhcg0KV291bGQg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