Article View: comp.arch
Article #83Re: Optimization by programmers
From: Niklas Holsti
Date: Tue, 13 Oct 2026 17:00
Date: Tue, 13 Oct 2026 17:00
39 lines
3118 bytes
3118 bytes
On 2026-10-13 13:27, Anton Ertl wrote: > Niklas Holsti <niklas.holsti@tidorum.invalid> writes: >> Forth originated in astronomy, if I remember correctly. I do remember >> that in an astronomy-domain Forth program, where it was often necessary >> to transform the celestial coordinates of stars from the standard >> catalog epoch (the start of the year 1950) to the current time, the word >> 1950.0 was defined to perform that transformation. > > That is unlikely, as explained below. I am rather sure that my memory is correct. This was quite a long time ago -- some time in the 1980s, IIRC. >> That Forth system did not have floating-point support, so 1950.0 could >> not be understood as a floating-point literal. But if the program had >> been ported to a Forth system with floating-point support, confusion >> could have resulted. > > Most Forth systems recognize strings like 1950.0 as double-cell > numbers. That's expecially true in early systems, where 16-bit cells > were too small for the arithmetic needs of many applications > (including in astronomy). OK, I did not know about that double-cell interpretation, so my comments about floating point are mistaken. > In early systems fixed-point was used a lot, and 1950.0 is > interpreted as 19500 with a scale factor of 1/10. The Forth program in question represented angles as fixed-point fractions (0 <= x < 1) of a full circle. I don't remember the number of bits used. Even if that Forth system by default interpreted 1950.0 as a double-cell number, apparently it was still possible to override that interpretation by defining a word called 1950.0. But I trust we agree that such word names are not to be recommended.
Technical Details
Message-ID:
<nj76d2FnesuU1@mid.individual.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<1177fdi$26ea4$1@dont-email.me> <11a3ofn$2ak3s$1@dont-email.me> <11a5hd5$4qb$1@reader2.panix.com> <11a5lqo$2v5bq$1@dont-email.me> <11a6870$41j$1@reader2.panix.com> <11a6a6h$37i1n$1@dont-email.me> <1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <2026Oct12.191033@mips.complang.tuwien.ac.at> <nj6aehFiusqU1@mid.individual.net> <2026Oct13.122712@mips.complang.tuwien.ac.at>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti <niklas.holsti@tidorum.invalid> Newsgroups: comp.arch Subject: Re: Optimization by programmers Date: Tue, 13 Oct 2026 20:00:18 +0300 Organization: Tidorum Ltd Lines: 39 Message-ID: <nj76d2FnesuU1@mid.individual.net> References: <1177fdi$26ea4$1@dont-email.me> <11a3ofn$2ak3s$1@dont-email.me> <11a5hd5$4qb$1@reader2.panix.com> <11a5lqo$2v5bq$1@dont-email.me> <11a6870$41j$1@reader2.panix.com> <11a6a6h$37i1n$1@dont-email.me> <1791742457-5857@newsgrouper.org> <11agm4p$2tfut$1@dont-email.me> <11ahs8q$38ir0$4@dont-email.me> <11aig3c$3hdcn$1@dont-email.me> <11aiqc0$3kr94$3@dont-email.me> <2026Oct12.191033@mips.complang.tuwien.ac.at> <nj6aehFiusqU1@mid.individual.net> <2026Oct13.122712@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 2yHaYQ6b60kJvvXqjW5HqwG4PV5tE7lNwUsoCsvQLqW2cPgJsJ Cancel-Lock: sha1:192NaIvXvxcR+R7i3ZjTJ+Wkgxc= sha256:ejqybrQmqd05BYxCa3pTIENK/QaXxjXIEoM1+X/zp3U= User-Agent: Mozilla Thunderbird Content-Language: en-US In-Reply-To: <2026Oct13.122712@mips.complang.tuwien.ac.at>