Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.acorn.programmer > #6004
| Subject | Re: Subtracting times |
|---|---|
| Newsgroups | comp.sys.acorn.programmer |
| From | Alan Adams <alan@adamshome.org.uk> |
| Date | 2020-02-28 11:21 +0000 |
| Message-ID | <20365a4958.Alan.Adams@ArmX6.adamshome.org.uk> (permalink) |
| References | (3 earlier) <12ecd44558.Alan.Adams@ArmX6.adamshome.org.uk> <r2r0as$11df$1@gioia.aioe.org> <r33gnb$1q0r$1@gioia.aioe.org> <6a72eb4758.Alan.Adams@ArmX6.adamshome.org.uk> <r38t89$nvf$1@gioia.aioe.org> |
| Organization | Orpheus Internet Services |
In message <r38t89$nvf$1@gioia.aioe.org>
Steve Drain <steve@kappa.me.uk> wrote:
> Alan Adams wrote:
>> That's so terse it makes my eyes water.
>> I don't think I will try to understand it.
> The original problem could be solved if BASIC would do arithmetic with
> unsigned integers. A 5-byte float can hold an unsigned integer exactly,
> but we have to get those integers into floats. I think the method I
> posted earlier is actually over-thought and more elaborate than it needs
> to be. Please let me know if this works for you:
With your followup correction, yes it works well.
> DEFFNdiff(a%,b%)
> LOCAL a,b,c:c=2^32
> IF !a%<0 THEN a=c+!a% ELSE a=!a%
> IF !b%<0 THEN b=c+!b% ELSE b=!b%
> =(a%!4-b%!4)*c+a-b
> This, some other ramblings, and an extension of the assembler routine
> that Martin posted, which will return negative values, are at:
> http://www.kappa.me.uk/Miscellaneous/swTimeDiff.zip
> I think the assembler routine is the most useful, but the BASIC one is
> quite satisfying. ;-)
--
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/
Back to comp.sys.acorn.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-18 11:55 +0000
Re: Subtracting times Jean-Michel <jmc.bruck@orange.fr> - 2020-02-18 19:11 +0100
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-21 03:28 -0800
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-21 12:45 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-21 15:17 +0000
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-22 10:37 +0000
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-25 16:05 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-25 16:35 +0000
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-27 17:10 +0000
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-27 10:06 -0800
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-28 11:21 +0000
Re: Subtracting times jeffrey.a.doggett@gmail.com - 2020-04-22 12:00 -0700
Re: Subtracting times Martin <News03@avisoft.f9.co.uk> - 2020-04-23 00:07 +0100
Re: Subtracting times jeffrey.a.doggett@gmail.com - 2020-04-23 03:13 -0700
Re: Subtracting times Martin <News03@avisoft.f9.co.uk> - 2020-04-23 18:01 +0100
Re: Subtracting times "John Williams (News)" <UCEbin@tiscali.co.uk> - 2020-04-23 18:06 +0100
Re: Subtracting times jeffrey.a.doggett@gmail.com - 2020-04-23 11:18 -0700
Re: Subtracting times Martin <News03@avisoft.f9.co.uk> - 2020-04-23 21:23 +0100
Re: Subtracting times David Higton <dave@davehigton.me.uk> - 2020-04-24 15:24 +0100
Re: Subtracting times David Higton <dave@davehigton.me.uk> - 2020-04-23 20:57 +0100
Re: Subtracting times jgh@mdfs.net - 2020-02-23 17:39 -0800
Re: Subtracting times Steve Drain <steve@kappa.me.uk> - 2020-02-24 10:23 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-24 11:12 +0000
Re: Subtracting times Martin <News03@avisoft.f9.co.uk> - 2020-02-24 13:05 +0000
Re: Subtracting times Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-02-19 08:35 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-19 10:03 +0000
Re: Subtracting times Sebastian Barthel <naitsabes@freenet.de> - 2020-02-19 13:04 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-19 16:41 +0000
Re: Subtracting times jgh@mdfs.net - 2020-02-19 12:01 -0800
Re: Subtracting times Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-02-23 20:46 +0000
Re: Subtracting times Martin <News03@avisoft.f9.co.uk> - 2020-02-19 23:54 +0000
Re: Subtracting times Alan Adams <alan@adamshome.org.uk> - 2020-02-20 11:18 +0000
csiph-web