# [plt-scheme] fractions and decimals

 From: Robert Bruce Findler (robby at cs.uchicago.edu) Date: Sun Jan 19 21:38:59 EST 2003 Previous message: [plt-scheme] fractions and decimals Next message: [plt-scheme] fractions and decimals Messages sorted by: [date] [thread] [subject] [author]

```I must say (not being the one to implement it :) that I really like the
idea of useing ... to indicate the overbar in DrScheme, but how do you
notate those rationals whose expansion includes multiple repeated
digits, like 1/70000:

0.0000142857
^^^^        nonrepeating
^^^^^^  repeating

Robby

At Sun, 19 Jan 2003 21:00:23 -0500, Paul Schlie wrote:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Wonder if broadly adopting the convention that decimals terminated with a
> zero (0), would be interpreted as an inexact number, otherwise considered
> exact; would help unify the two worlds; (little fancier would be to
> interpret ".." as an exact repeating input pattern, although not sure how
> to reliably convert it into an exact fractional internal representation.
>
> 1      == 1      ; exact
> 1.0    == 1.0    ; inexact
>
> 0.125  == 1/8    ; exact
> 0.1250 == 0.1250 ; inexact
>
> 0.3..  == 1/3    ; exact
> 0.33   == 33/100 ; exact
> 0.3330 == 0.3330 ; inexact
>
> Such if decimal outputs are specified as being preferred:
>
> 1/8    => 0.125  ; exact to the specified decimal precision.
> 0.125  => 0.125  ; exact to the specified decimal precision.
> 0.1250 => 0.1250 ; inexact to the specified decimal precision.
>
> 1/3    => 0.3..  ; exact to the specified decimal precision.
> 0.33   => 0.33   ; exact to the specified decimal precision.
> 0.3330 => 0.3330 ; inexact to the specified decimal precision.
>
> Or if fractional output were specified as being preferred:
>
> 1/8    => 1/8    ; exact to the specified decimal precision.
> 0.125  => 1/8    ; exact to the specified decimal precision.
> 0.1250 => 0.1250 ; inexact to the specified decimal precision.
>
> 1/3    => 1/3    ; exact to the specified decimal precision.
> 0.3..  => 1/3    ; exact to the specified decimal precision.
> 0.33   => 33/100 ; exact to the specified decimal precision.
> 0.3330 => 0.3330 ; inexact to the specified decimal precision.
>
> (where ".." would be replaced with an over-bar within DrScheme, but
>  copied to the clipboard as "..", to enable a successive pastes)
>
> Which overall seems reasonably nice and simple,
>
> -paul-

```

 Posted on the users mailing list. Previous message: [plt-scheme] fractions and decimals Next message: [plt-scheme] fractions and decimals Messages sorted by: [date] [thread] [subject] [author]