Re: [Ql-Users] Wrong dates on DOS & NFA
Hi Dilwyn I played with your Sync program myself recently and noticed what appeared to be a mistake in how a file's Update-date was being extracted from the directory (GET in to a float, rather than LGET for the Long-word Date.) Not sure if I was using your latest version (downloaded form your site a few weeks ago), but I corrected it and it then worked for me (on QEm and QPC). As its not the primary topic of this thread, I can email you off-list to discuss further, if you like... Oh, and Happy New year to everyone! Martyn Hill. On 02/01/2017 14:54, Dilwyn Jones wrote: I wonder if this would also explain why I get occasional queries that my Sync program does not always handle dates correctly and sometimes gets older/newer ones wrong? (Something I have not been able to reproduce here) Dilwyn -Original Message- From: Bob Spelten Sent: Monday, January 02, 2017 1:53 PM To: ql-us...@q-v-d.com Subject: [Ql-Users] Wrong dates on DOS & NFA Hi All, I noticed some inconsistency in the use of emulator dates. When using QPAC2's Backup (v1.46) to copy a file from WIN to DOS or NFA, dates are not always maintained. Under QPC2 v3.40(3.16) the date is kept correct. Under QPC2 v4.04(3.26) the date is cleared to 1.1.1961 Under SMSQ/m v2.20(3.27) the date is set to the current date, like Copy does. All tested on my PC running W$7. Why? Bob -- "There are 10 types of people in this world. Those who understand binary and those who don't." ___ QL-Users Mailing List
Re: [Ql-Users] Wrong dates on DOS & NFA
Hi Dilwyn I played with your Sync program myself recently (thank you!) and noticed what appeared to be a mistake in how a source file's Update-date was being extracted from the directory - GET in to a float (updt1) , rather than LGET for the long-word Date. Not sure if I was using your latest version (downloaded form your site a few weeks ago), but I corrected it and it then worked for me (on both QEm and QPC). As its not the primary topic of this thread, I can email you off-list to discuss further, if you like... Oh, and Happy New year to everyone! Martyn Hill. On 02/01/2017 14:54, Dilwyn Jones wrote: I wonder if this would also explain why I get occasional queries that my Sync program does not always handle dates correctly and sometimes gets older/newer ones wrong? (Something I have not been able to reproduce here) Dilwyn -Original Message- From: Bob Spelten Sent: Monday, January 02, 2017 1:53 PM To: ql-us...@q-v-d.com Subject: [Ql-Users] Wrong dates on DOS & NFA Hi All, I noticed some inconsistency in the use of emulator dates. When using QPAC2's Backup (v1.46) to copy a file from WIN to DOS or NFA, dates are not always maintained. Under QPC2 v3.40(3.16) the date is kept correct. Under QPC2 v4.04(3.26) the date is cleared to 1.1.1961 Under SMSQ/m v2.20(3.27) the date is set to the current date, like Copy does. All tested on my PC running W$7. Why? Bob ___ QL-Users Mailing List
[Ql-Users] Bevaiour of DIV with negative numbers in SBASIC (QPC2)
Hi everyone Can anyone tell me the expected behaviour for the integer-divide operator 'DIV' in SBASIC, when provided with a negative dividend/numerator? My number-theory is a bit rusty, but I would have thought that, say, -1 DIV 10 should result in 0 (with remainder/MOD of -1). Instead, on QPC2/SBASIC, I get the result -1 for that example - and (almost) always 1 less than expected for negative dividends, thus: 12 DIV 10 = 1 11 DIV 10 = 1 10 DIV 10 = 1 9 DIV 10 = 0 ... 2 DIV 10 = 0 1 DIV 10 = 0 0 DIV 10 = 0 * -1 DIV 10 = -1 - expected '0'** ** -2 DIV 10 = -1** **...** ** -9 DIV 10 = -1* *-10 DIV 10 = -1 - as expected* *-11 DIV 10 = -2 - expected '-1' -12 DIV 10 = -2 *etc... Thanks in advance! Martyn. ___ QL-Users Mailing List
Re: [Ql-Users] Behaviour of DIV with negative numbers in SBASIC (QPC2)
Martyn, Integer division for negative numbers is not very well defined. Language designers get to choose if their language will round towards zero, negative infinity, or positive infinity when doing integer division. Different languages have made different choices. S*Basic designers have chosen to use the "flooring" approach (round the floating point result to the next smaller number). Some other reasoning: -1 / 2 should be? (1) -1/2 = 0 remainder -1 (2)$ ASR 1 = $ = -1 Another note: The original QL allowed word-size divisors and dividends. while SMSQ/E extended this to long integers. And the original QL manual even had an example illustrating what you see here: -5 DIV 2 { will output -3} Tobias > Am 05.01.2017 um 16:27 schrieb Martyn Hill : > > Hi everyone > > Can anyone tell me the expected behaviour for the integer-divide operator > 'DIV' in SBASIC, when provided with a negative dividend/numerator? > > My number-theory is a bit rusty, but I would have thought that, say, -1 DIV > 10 should result in 0 (with remainder/MOD of -1). > > Instead, on QPC2/SBASIC, I get the result -1 for that example - and (almost) > always 1 less than expected for negative dividends, thus: > > 12 DIV 10 = 1 > 11 DIV 10 = 1 > 10 DIV 10 = 1 > 9 DIV 10 = 0 > ... > 2 DIV 10 = 0 > 1 DIV 10 = 0 > 0 DIV 10 = 0 > * -1 DIV 10 = -1 - expected '0'** > ** -2 DIV 10 = -1** > **...** > ** -9 DIV 10 = -1* > *-10 DIV 10 = -1 - as expected* > *-11 DIV 10 = -2 - expected '-1' > -12 DIV 10 = -2 > > *etc... > > Thanks in advance! > > Martyn. > ___ > QL-Users Mailing List ___ QL-Users Mailing List
Re: [Ql-Users] Behaviour of DIV with negative numbers in SBASIC (QPC2)
Thank you Tobias! Makes sense with that context. M. On 05/01/2017 15:49, Tobias Fröschle wrote: Martyn, Integer division for negative numbers is not very well defined. Language designers get to choose if their language will round towards zero, negative infinity, or positive infinity when doing integer division. Different languages have made different choices. S*Basic designers have chosen to use the "flooring" approach (round the floating point result to the next smaller number). Some other reasoning: -1 / 2 should be? (1) -1/2 = 0 remainder -1 (2)$ ASR 1 = $ = -1 Another note: The original QL allowed word-size divisors and dividends. while SMSQ/E extended this to long integers. And the original QL manual even had an example illustrating what you see here: -5 DIV 2 { will output -3} Tobias Am 05.01.2017 um 16:27 schrieb Martyn Hill : Hi everyone Can anyone tell me the expected behaviour for the integer-divide operator 'DIV' in SBASIC, when provided with a negative dividend/numerator? My number-theory is a bit rusty, but I would have thought that, say, -1 DIV 10 should result in 0 (with remainder/MOD of -1). Instead, on QPC2/SBASIC, I get the result -1 for that example - and (almost) always 1 less than expected for negative dividends, thus: 12 DIV 10 = 1 11 DIV 10 = 1 10 DIV 10 = 1 9 DIV 10 = 0 ... 2 DIV 10 = 0 1 DIV 10 = 0 0 DIV 10 = 0 * -1 DIV 10 = -1 - expected '0'** ** -2 DIV 10 = -1** **...** ** -9 DIV 10 = -1* *-10 DIV 10 = -1 - as expected* *-11 DIV 10 = -2 - expected '-1' -12 DIV 10 = -2 *etc... Thanks in advance! Martyn. ___ QL-Users Mailing List ___ QL-Users Mailing List -- "There are 10 types of people in this world. Those who understand binary and those who don't." ___ QL-Users Mailing List
Re: [Ql-Users] Wrong dates on DOS & NFA
Thank you Martin, I'll sort this out as soon as I get a chance. Dilwyn -Original Message- From: Martyn Hill Sent: Thursday, January 05, 2017 10:16 AM To: ql-users@lists.q-v-d.com Subject: Re: [Ql-Users] Wrong dates on DOS & NFA Hi Dilwyn I played with your Sync program myself recently and noticed what appeared to be a mistake in how a file's Update-date was being extracted from the directory (GET in to a float, rather than LGET for the Long-word Date.) Not sure if I was using your latest version (downloaded form your site a few weeks ago), but I corrected it and it then worked for me (on QEm and QPC). As its not the primary topic of this thread, I can email you off-list to discuss further, if you like... Oh, and Happy New year to everyone! Martyn Hill. On 02/01/2017 14:54, Dilwyn Jones wrote: I wonder if this would also explain why I get occasional queries that my Sync program does not always handle dates correctly and sometimes gets older/newer ones wrong? (Something I have not been able to reproduce here) Dilwyn -Original Message- From: Bob Spelten Sent: Monday, January 02, 2017 1:53 PM To: ql-us...@q-v-d.com Subject: [Ql-Users] Wrong dates on DOS & NFA Hi All, I noticed some inconsistency in the use of emulator dates. When using QPAC2's Backup (v1.46) to copy a file from WIN to DOS or NFA, dates are not always maintained. Under QPC2 v3.40(3.16) the date is kept correct. Under QPC2 v4.04(3.26) the date is cleared to 1.1.1961 Under SMSQ/m v2.20(3.27) the date is set to the current date, like Copy does. All tested on my PC running W$7. Why? Bob -- "There are 10 types of people in this world. Those who understand binary and those who don't." ___ QL-Users Mailing List - No virus found in this message. Checked by AVG - www.avg.com Version: 2016.0.7996 / Virus Database: 4749/13712 - Release Date: 01/05/17 ___ QL-Users Mailing List