Basic Shift Right

Anything QL Software or Programming Related.
martyn_hill
Gold Card
Posts: 409
Joined: Sat Oct 25, 2014 9:53 am

Re: Basic Shift Right

Postby martyn_hill » Tue Sep 12, 2017 3:25 am

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
Trump Card
Posts: 154
Joined: Sun Jan 18, 2015 1:29 am

Re: Basic Shift Right

Postby ql_freak » Wed Sep 27, 2017 11:58 pm

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 :-)

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 3 guests