Basic Shift Right

Anything QL Software or Programming Related.
martyn_hill
Aurora
Posts: 909
Joined: Sat Oct 25, 2014 9:53 am

Re: Basic Shift Right

Post by martyn_hill »

Hi Peter

I don't see a problem like you do.

If the original numberToShift passed to the extension exceeded the (signed) 32-bit range, then an error would be returned when the GETLN support routine is used to fetch the parameter.

The resultant shifted number will always remain within 32-bits, so will return valid, albeit as a FP, normalised value. The only 'anomaly' might be that it changes sign in the process.

Or am I missing something?

:-)


User avatar
ql_freak
Gold Card
Posts: 353
Joined: Sun Jan 18, 2015 1:29 am

Re: Basic Shift Right

Post by ql_freak »

martyn_hill wrote:Hi Peter

I don't see a problem like you do.

If the original numberToShift passed to the extension exceeded the (signed) 32-bit range, then an error would be returned when the GETLN support routine is used to fetch the parameter.

The resultant shifted number will always remain within 32-bits, so will return valid, albeit as a FP, normalised value. The only 'anomaly' might be that it changes sign in the process.

Or am I missing something?

:-)
Sorry for the late answer! I finally start my new job at October 4th, so I haven't had much time, still preparing for my new job.

Of course you are right!


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply