<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>I agree that, given a modern x86 computer, it is possible to just ignore integer arithmetic altogether and use floats. There may be some numerical programs that can be written to run faster using integer arithmetic than floats, but this would be rare. There may also be some numerical programs that need the higher precision of integer arithmetic than floats (on a 64-bit x86, single-precision is 64-bit and double-precision is 128-bit, as compared to the floats which provide only a 72-bit mantissa for an 80-bit float), but this would also be rare.</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 15.555556297302246px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">The Lua language does only support floats, and does not have an integer data type. I have
 written software for generating CNC gcode, and may write a general-purpose CAM program later on. For something like that, it is a good idea to use floats only. Most machinists are not programmers and they largely seem baffled as to why programming languages distinguish between integers and floats --- the scientific calculator that they use everyday when writing gcode manually doesn't make any such distinction. It seems to make about as much sense as having separate data types for even numbers and odd numbers --- they are all just numbers, after all, so why complicate the subject with arbitrary distinctions? :-)</div><div style="color: rgb(0, 0, 0); font-size: 15.555556297302246px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 15.555556297302246px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent;
 font-style: normal;">I'm mostly thinking in terms of 16-bit processors that don't have a numerical coprocessor when I say that mixed-precision integer arithmetic is important. In the old days, that meant desktop computers --- now it only means micro-controllers. Scheme will never be used on micro-controllers, and lack of support for integer arithmetic is only one of the many reasons why --- but I think that Scheme is a good language for desktop computers.</div><div style="color: rgb(0, 0, 0); font-size: 15.555556297302246px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 15.555556297302246px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"><div style="font-family: 'times new
 roman', 'new york', times, serif; font-size: 12pt;">Message: 2<br>Date: Wed, 21 Nov 2012 09:36:14 +0000<br>From: Norman Gray &lt;<a ymailto="mailto:norman@astro.gla.ac.uk" href="mailto:norman@astro.gla.ac.uk">norman@astro.gla.ac.uk</a>&gt;<br>To: Hendrik Boom &lt;<a ymailto="mailto:hendrik@topoi.pooq.com" href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a>&gt;<br>Cc: <a ymailto="mailto:users@racket-lang.org" href="mailto:users@racket-lang.org">users@racket-lang.org</a><br>Subject: Re: [racket] LC53<br>Message-ID: &lt;<a ymailto="mailto:37E7D524-8E22-4F35-8D05-8C2A993B57F8@astro.gla.ac.uk" href="mailto:37E7D524-8E22-4F35-8D05-8C2A993B57F8@astro.gla.ac.uk">37E7D524-8E22-4F35-8D05-8C2A993B57F8@astro.gla.ac.uk</a>&gt;<br>Content-Type: text/plain; charset=windows-1252<br><br><br>Hendrik (and Hugh), hello.<br><br>OK -- I'll bite, if only to see where this argument heads to.<br><br>On 2012 Nov 20, at 13:56, Hendrik Boom &lt;<a
 ymailto="mailto:hendrik@topoi.pooq.com" href="mailto:hendrik@topoi.pooq.com">hendrik@topoi.pooq.com</a>&gt; wrote:<br><br>&gt; On Tue, Nov 20, 2012 at 11:02:06AM +0000, Norman Gray wrote:<br>&gt;&gt; <br>&gt;&gt; I think list members might experience a certain amount of surprise at your conclusions...<br>&gt;&gt; <br>&gt;&gt; On 2012 Nov 20, at 02:34, Hugh Aguilar wrote:<br>&gt;&gt; <br>&gt;&gt;&gt; For a numerical program it is necessary to have mixed-precision arithmetic. [...] Scheme, Python, Ruby, C/C++, Fortran, Java, etc., don't have this<br>&gt;&gt; <br>&gt;&gt; ...that Fortran is unsuitable for numerical programming,<br>&gt; <br>&gt; Starting with Fortran, high-level languages have forgotten that the <br>&gt; product of two numbers should be accurately available as a <br>&gt; number with twice the precision.<br>&gt; <br>&gt; NOw if the numbers were approximate to start with, this is no big deal, <br>&gt; but if they were exact (as integers
 usually are), it can be crucial for <br>&gt; some numerical algorithms.&nbsp; It mystifies me why this situation has <br>&gt; persisted for over half a century.<br><br>I think that 'should', 'can be' and 'mystifies' are the key words or phrases here.<br><br>I suspect that, for most people, 'numerical programming' means the stock-in-trade of scientific programming -- namely the calculations of numerical values for equations of all types, including integration, differentiation, interpolation, and so on and so (very much) forth.&nbsp; That is, we're talking about floats, in all but a few cases; integer-only algorithms are a very specialised category of 'numerical programming'<br><br>Floats, as you note, are approximate from the outset (especially if what they represent is measured data; apart from ordinal data, data is approximate).&nbsp; Having any non-trivial float calculation double in precision at each operation would be? not terribly sensible.&nbsp;
 Thus, contra your 'should', it is possibly not unreasonable to have such a facility available in a language, or in a dialect of a language, but it is of use to such a small fraction of a language's users (thinking of Python, C, Fortran, for example), that the extra specification and implementation effort may have a negative utility.<br><br>So Fortran hasn't 'forgotten' that arbitrarily extended precision 'should' be available, certainly not for floats, and rarely even for integers.&nbsp; And I'm sure that approximately zero people here have difficulty (Hugh) 'grasping' the concept of mixed-precision arithmetic.&nbsp; This was never particularly sensible in (the main dialect of) a general purpose language, and there is no mystery here at all.<br><br>Best wishes (in slight puzzlement),<br><br>Norman<br><br><br>-- <br>Norman Gray&nbsp; :&nbsp; <a href="http://nxg.me.uk/" target="_blank">http://nxg.me.uk</a><br>SUPA School of Physics and Astronomy,
 University of Glasgow, UK<br><br><br> </div> </div>  </div></body></html>