Re: [racket-users] Re: Why is 3d3 a number?

2016-09-20 Thread Robby Findler
Patches to the reader for a more sane number syntax to be used in the
teaching languages are welcome. Note that we already have some of
these in place, as 1.2 reads as a rational in the teaching languages.

Robby


On Tue, Sep 20, 2016 at 10:39 AM, Ben Greenman
 wrote:
> Whew, fantastic! Thank you.
> (Should I tell the Fundamentals I students about R6RS?)
>
>
> On Tue, Sep 20, 2016 at 11:32 AM, Asumu Takikawa 
> wrote:
>>
>> On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
>> >Oh! Just found that common lisp used these for types:
>> >- s = short
>> >- f = single
>> >- d = double
>> >- l = long
>>
>> I think it's more specifically an R6RS thing. Quoth the standard:
>>
>>   In systems with inexact number objects of varying precisions, it may be
>> useful
>>   to specify the precision of a constant. For this purpose,
>> representations of
>>   number objects may be written with an exponent marker that indicates the
>>   desired precision of the inexact representation. The letters s, f, d,
>> and l
>>   specify the use of short, single, double, and long precision,
>> respectively.
>>   (When fewer than four internal inexact representations exist, the four
>> size
>>   specifications are mapped onto those available. For example, an
>> implementation
>>   with two internal representations may map short and single together and
>> long
>>   and double together.) In addition, the exponent marker e specifies the
>> default
>>   precision for the implementation. The default precision has at least as
>> much
>>   precision as double, but implementations may wish to allow this default
>> to be
>>   set by the user.
>>
>>   http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8
>>
>> Cheers,
>> Asumu
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Why is 3d3 a number?

2016-09-20 Thread Asumu Takikawa
On 2016-09-20 11:32:35 -0400, Asumu Takikawa wrote:
>   For example, an implementation with two internal representations may map
>   short and single together and long and double together.

BTW, I think this is what Racket does. It just has single and double.

  > 283403902385293s1
  2.834039f+15
  > 283403902385293f1
  2.834039f+15
  > 283403902385293d1
  2.83403902385293e+15
  > 283403902385293l1
  2.83403902385293e+15

As noted in the Reference:

Inexact real numbers are implemented as either single- or double-precision
  IEEE floating-point numbers—the latter by default, and the former only when a
  computation starts with numerical constants specified as single-precision
  numbers.

Cheers,
Asumu

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Why is 3d3 a number?

2016-09-20 Thread Ben Greenman
Whew, fantastic! Thank you.
(Should I tell the Fundamentals I students about R6RS?)


On Tue, Sep 20, 2016 at 11:32 AM, Asumu Takikawa 
wrote:

> On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
> >Oh! Just found that common lisp used these for types:
> >- s = short
> >- f = single
> >- d = double
> >- l = long
>
> I think it's more specifically an R6RS thing. Quoth the standard:
>
>   In systems with inexact number objects of varying precisions, it may be
> useful
>   to specify the precision of a constant. For this purpose,
> representations of
>   number objects may be written with an exponent marker that indicates the
>   desired precision of the inexact representation. The letters s, f, d,
> and l
>   specify the use of short, single, double, and long precision,
> respectively.
>   (When fewer than four internal inexact representations exist, the four
> size
>   specifications are mapped onto those available. For example, an
> implementation
>   with two internal representations may map short and single together and
> long
>   and double together.) In addition, the exponent marker e specifies the
> default
>   precision for the implementation. The default precision has at least as
> much
>   precision as double, but implementations may wish to allow this default
> to be
>   set by the user.
>
>   http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8
>
> Cheers,
> Asumu
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Why is 3d3 a number?

2016-09-20 Thread Asumu Takikawa
On 2016-09-20 11:27:07 -0400, Ben Greenman wrote:
>Oh! Just found that common lisp used these for types:
>- s = short
>- f = single
>- d = double
>- l = long

I think it's more specifically an R6RS thing. Quoth the standard:

  In systems with inexact number objects of varying precisions, it may be useful
  to specify the precision of a constant. For this purpose, representations of
  number objects may be written with an exponent marker that indicates the
  desired precision of the inexact representation. The letters s, f, d, and l
  specify the use of short, single, double, and long precision, respectively.
  (When fewer than four internal inexact representations exist, the four size
  specifications are mapped onto those available. For example, an implementation
  with two internal representations may map short and single together and long
  and double together.) In addition, the exponent marker e specifies the default
  precision for the implementation. The default precision has at least as much
  precision as double, but implementations may wish to allow this default to be
  set by the user.

  http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.2.8

Cheers,
Asumu

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.