Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 2
    How was array indexing handled? If using row-major subscripts, would one have to expend special efforts to ensure that given ARR{10,4) an attempt to access ARR(2.5,3) wouldn't access ARR(3,1)? Commented Jun 21, 2022 at 16:40
  • @supercat I don't see how it relates to the topic. Please clarify your question. Moreover, in Fortran (to which you presumably allude), there were no bound checks. Commented Jun 21, 2022 at 21:46
  • 2
    @supercat As Fortran is column-major, I had to change the indexing to exhibit the issue. The oldest Fortran compiler is silly: ARR(3, 2.5) returns the value assigned to ARR(8, 2); another one takes ARR(3, 2.5) as ARR(3, 2); the third one (written in the GDR) errors out with SUBSCRIPT OF ARRAY HAS NOT INTEGER TYPE. This has nothing to do with representation of floating point or integers, it is purely a compiler issue. Commented Jun 21, 2022 at 22:11
  • 1
    Based on your last comment, I hope you figured out how my comment relates to the issue: multi-dimensional array indexing inherently involves integer multiplication and would be a bit awkward if all that existed were floating-point values, though I guess if one had a machine where all addresses were within the same power-of-two range it may be possible to treat the bottom portion of the mantissa as an address without having to do anything special to force the exponent value. Commented Jun 21, 2022 at 22:36
  • 1
    @supercat To use a number as an address, it has to be denormalized. The 15 least-significant bits of mantissa are used as the address. Commented Jun 22, 2022 at 16:53