On Tue, Jul 9, 2019 at 2:07 PM Peter Bex <[email protected]> wrote:

They could be, but Scheme does not really allow for multiple types
> of inexact numbers.


Actually it has no problem with them.  There are literals for up to four
separate inexact types, using S, F, D,  and L as exponent markers, and
arithmetic just requires that when two float types meet the shorter is
widened  and that in systems without rationals, the widest available float
is returned from division.  The flags and the widening coercion are
inherited from Common Lisp.

Currently Kawa (which inherits its two floating types from Java) supports
32-bit floats with the S or F flag, as well as standard 64-bit floats with
the E, D, or L flag.  So does Racket/C, but Racket/Chez does not, and it
probably never will (since Chez does not) except perhaps as a separate type
that doesn't participate in the numeric tower.

It would also slow everything down even further
> due to even more dispatching.


That's for sure.  It's one of the reasons why ad hoc polymorphism is not
really Scheme's thing, with the big exceptions of numbers and ports; the
more types you support ad hoc, the worse your performance is.


> So it sounds like a modified C compiler and/or FPU would be the way to go
> for this.


Hardware support for posits will come shortly after the Devil dies of
exposure.


John Cowan          http://vrici.lojban.org/~cowan        [email protected]
What asininity could I have uttered that they applaud me thus?
        --Phocion, Greek orator
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to