Harald Loeffler | 12 Nov 1993 10:36
Picon
Picon

(unknown)

Hi,
we have found a new (?) bug in your scheme48 0.17:

     (sqrt 1) causes a DIVISON BY ZERO error.

Harald Loeffler | 25 Nov 1993 09:18
Picon
Picon

Possible bug ?

Hello guys !

I have a question about how to get a number of the typ "real"
All my procedures give me figures like :  345534654365436/3245324663346

Is this normal ? I don't think so, because in other scheme-implementations
I can fix this problem by multiplikating the number with 1.0.

I hope you can help me.

Thanks

Harald Loeffler

kelsey | 25 Nov 1993 16:05
Picon

Possible bug ?


   From: Harald Loeffler <loefflhd <at> trick.informatik.uni-stuttgart.de>
   Date: Thu, 25 Nov 93 09:18:56 +0100

   I have a question about how to get a number of the typ "real"
   All my procedures give me figures like :  345534654365436/3245324663346

   Is this normal ? I don't think so, because in other scheme-implementations
   I can fix this problem by multiplikating the number with 1.0.

The current version of Scheme 48 does not have floating point numbers.
Real numbers are represented as inexact rational numbers:

  > 23/10
  23/10
  > #i23/10
  2.3
  >

You can make numbers look more as you might expect:

  > (define precision 10000000)
  > (define (print-as-float x)
      (display (exact->inexact (/ (quotient (* precision (numerator x))
                                            (denominator x))
                                  precision))))
  > (begin (print-as-float 345534654365436/3245324663346) (newline))
  106.4715214
  >

(Continue reading)


Gmane