From: Dmitry A. Kazakov on
On Fri, 5 Feb 2010 01:02:40 -0800 (PST), Martin wrote:

> On Feb 5, 8:52�am, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:
>> Martin wrote on comp.lang.ada:
>>
>>
>>
>>> On Feb 5, 6:42�am, Dennis Lee Bieber <wlfr...(a)ix.netcom.com> wrote:
>>> > On Thu, 04 Feb 2010 19:46:15 +0100, Pascal Obry <pas...(a)obry.net>
>>> > declaimed the following in comp.lang.ada:
>>> > > I know that the F-22 is 90% of Ada. Is there some public information
>>> > > about this bug? Is that a design bug?
>>
>>> > � � � � So far as I recall -- from some years ago -- it was an algorithm
>>> > problem handling position information wrap-around from crossing, as
>>> > mentioned, the International Dateline... -180.0 to +180.0 deg longitude.
>>
>>> > � � � � I didn't hear that they had to follow the tankers back -- was under
>>> > the impression once they managed to cross back heading east a reboot of
>>> > the navigation system started working again...
>>
>>> > --
>>> > � � � � Wulfraed � � � � Dennis Lee Bieber � � � � � � � KD6MOG
>>> > � � � � wlfr...(a)ix.netcom.com HTTP://wlfraed.home.netcom.com/
>>
>>> For some reason (that I don't get at all) lots of systems define long
>>> as -180 <= x <= +180 degrees.
>>
>>> Having the potential to alias a position seems like a bad idea for a
>>> start, so when I've been coding such systems up, I've always spent a
>>> bit of time making it convert positions into the range -180 <= x <
>>> +180 degrees and using a proper ADT.
>>
>>> I wonder if it was anything to do with that?...
>>
>> I would have thought a longitude was really a mod 360, shifted by -180
>> for display purposes? For fractional degrees (i.e. minutes and
>> seconds), make that mod (360 * 60 * 60), shift by -180 * 60 * 60 and
>> split in degrees, minutes and seconds when displaying.
>>
>> --
>> Ludovic Brenta.
>
> No...it's -180 <= x <(=) +180...always - check any map / globe!!
>
> Lat is always -90 <= x <= +90 deg - no doubt about that one :-)
>
> Adding "shifts" would make understanding any problem very hard...

And shift does not solve the problem anyway, if that existed. The potential
problem is that the angle is not a real number. It could be represented by
one, but then the operations like +, -, *, /, =, /= must be replaced and
ones like <, >, <=, >= disallowed. With that done the value +180 would do
no harm, because -180 = +180 in terms of proper ADT operations. You simply
would not be able to distinguish them (without tricks like
Unchecked_Conversion).

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Martin on
On Feb 5, 10:31 am, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
wrote:
> On Fri, 5 Feb 2010 01:02:40 -0800 (PST), Martin wrote:
> > On Feb 5, 8:52 am, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:
> >> Martin wrote on comp.lang.ada:
>
> >>> On Feb 5, 6:42 am, Dennis Lee Bieber <wlfr...(a)ix.netcom.com> wrote:
> >>> > On Thu, 04 Feb 2010 19:46:15 +0100, Pascal Obry <pas...(a)obry.net>
> >>> > declaimed the following in comp.lang.ada:
> >>> > > I know that the F-22 is 90% of Ada. Is there some public information
> >>> > > about this bug? Is that a design bug?
>
> >>> >         So far as I recall -- from some years ago -- it was an algorithm
> >>> > problem handling position information wrap-around from crossing, as
> >>> > mentioned, the International Dateline... -180.0 to +180.0 deg longitude.
>
> >>> >         I didn't hear that they had to follow the tankers back -- was under
> >>> > the impression once they managed to cross back heading east a reboot of
> >>> > the navigation system started working again...
>
> >>> > --
> >>> >         Wulfraed         Dennis Lee Bieber               KD6MOG
> >>> >         wlfr...(a)ix.netcom.com HTTP://wlfraed.home.netcom.com/
>
> >>> For some reason (that I don't get at all) lots of systems define long
> >>> as -180 <= x <= +180 degrees.
>
> >>> Having the potential to alias a position seems like a bad idea for a
> >>> start, so when I've been coding such systems up, I've always spent a
> >>> bit of time making it convert positions into the range -180 <= x <
> >>> +180 degrees and using a proper ADT.
>
> >>> I wonder if it was anything to do with that?...
>
> >> I would have thought a longitude was really a mod 360, shifted by -180
> >> for display purposes? For fractional degrees (i.e. minutes and
> >> seconds), make that mod (360 * 60 * 60), shift by -180 * 60 * 60 and
> >> split in degrees, minutes and seconds when displaying.
>
> >> --
> >> Ludovic Brenta.
>
> > No...it's -180 <= x <(=) +180...always - check any map / globe!!
>
> > Lat is always -90 <= x <= +90 deg - no doubt about that one :-)
>
> > Adding "shifts" would make understanding any problem very hard...
>
> And shift does not solve the problem anyway, if that existed. The potential
> problem is that the angle is not a real number. It could be represented by
> one, but then the operations like +, -, *, /, =, /= must be replaced and
> ones like <, >, <=, >= disallowed. With that done the value +180 would do
> no harm, because -180 = +180 in terms of proper ADT operations. You simply
> would not be able to distinguish them (without tricks like
> Unchecked_Conversion).
>
> --
> Regards,
> Dmitry A. Kazakovhttp://www.dmitry-kazakov.de

Yup, instead you end up with functions like "Is_Between (Anlge, First,
Last : Longitude) return Boolean"

Although because have 'clever' construct functions "Longitude (From :
Float)" that always put things in the 'correct' range (-180 <= x <
180), we could allow "=" (and "/=").

Cheers
-- Martin
From: Hibou57 (Yannick Duchêne) on
On 5 fév, 11:31, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
wrote:
> And shift does not solve the problem anyway, if that existed. The potential
> problem is that the angle is not a real number. It could be represented by
> one, but then the operations like +, -, *, /, =, /= must be replaced and
> ones like <, >, <=, >= disallowed.

I would have thought for reals, operations like +, -, *, /, <, >, /=
changed and =, <=, >= disallowed
Is there something I don't understand ?
From: Dmitry A. Kazakov on
On Fri, 5 Feb 2010 08:50:31 -0800 (PST), Hibou57 (Yannick Duch�ne) wrote:

> On 5 f�v, 11:31, "Dmitry A. Kazakov" <mail...(a)dmitry-kazakov.de>
> wrote:
>> And shift does not solve the problem anyway, if that existed. The potential
>> problem is that the angle is not a real number. It could be represented by
>> one, but then the operations like +, -, *, /, =, /= must be replaced and
>> ones like <, >, <=, >= disallowed.
>
> I would have thought for reals, operations like +, -, *, /, <, >, /=
> changed and =, <=, >= disallowed
> Is there something I don't understand ?

You can compare angles, but cannot order them, at least while keeping
transitivity of ">":

a > b /\ b > c => a > c

Also a combination of operations like yours is impossible:

a /= b <=> not (a = b)

through the law of excluded middle (if not in the intuitionistic logic).
Then:

a > b \/ a = b <=> a >= b

So ">" and "/=" would carry the rest with.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Phil Clayton on
On Feb 5, 9:02 am, Martin <martin.do...(a)btopenworld.com> wrote:
> On Feb 5, 8:52 am, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote:
>
>
>
> > Martin wrote on comp.lang.ada:
>
> > > On Feb 5, 6:42 am, Dennis Lee Bieber <wlfr...(a)ix.netcom.com> wrote:
> > > > On Thu, 04 Feb 2010 19:46:15 +0100, Pascal Obry <pas...(a)obry.net>
> > > > declaimed the following in comp.lang.ada:
> > > > > I know that the F-22 is 90% of Ada. Is there some public information
> > > > > about this bug? Is that a design bug?
>
> > > >         So far as I recall -- from some years ago -- it was an algorithm
> > > > problem handling position information wrap-around from crossing, as
> > > > mentioned, the International Dateline... -180.0 to +180.0 deg longitude.
>
> > > >         I didn't hear that they had to follow the tankers back -- was under
> > > > the impression once they managed to cross back heading east a reboot of
> > > > the navigation system started working again...
>
> > > > --
> > > >         Wulfraed         Dennis Lee Bieber               KD6MOG
> > > >         wlfr...(a)ix.netcom.com HTTP://wlfraed.home.netcom.com/
>
> > > For some reason (that I don't get at all) lots of systems define long
> > > as -180 <= x <= +180 degrees.
>
> > > Having the potential to alias a position seems like a bad idea for a
> > > start, so when I've been coding such systems up, I've always spent a
> > > bit of time making it convert positions into the range -180 <= x <
> > > +180 degrees and using a proper ADT.
>
> > > I wonder if it was anything to do with that?...
>
> > I would have thought a longitude was really a mod 360, shifted by -180
> > for display purposes? For fractional degrees (i.e. minutes and
> > seconds), make that mod (360 * 60 * 60), shift by -180 * 60 * 60 and
> > split in degrees, minutes and seconds when displaying.
>
> > --
> > Ludovic Brenta.
>
> No...it's -180 <= x <(=) +180...always - check any map / globe!!
>
> Lat is always -90 <= x <= +90 deg - no doubt about that one :-)
>
> Adding "shifts" would make understanding any problem very hard...
>
> "So the position coming in is (+40, -100) but what's that inside the
> code again????"

Interesting to see that 'cyclic fixed point types' are under
discussion:

http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0175-1.txt?rev=1.2

http://www.ada-auth.org/ai-files/minutes/min-0911.html#AI175

Phil
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Ada in Boeing 787
Next: Private or public task ?