This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

# Ticket 290: Proposed square procedure

2012-10-05 06:58:47
WG1 - Numerics
cowan
major
cowan
fixed
source
closed
2011-09-25 06:22:49
defect

A square primitive is useful in calculating with bignums because squaring a bignum is generally cheaper than multiplying two different bignums of the same size. For example, Gambit's runtime checks trivially whether the two arguments in (* a b) are eq? before calling the appropriate algorithm. Generally, it may be better to be able to express this primitive directly.

[He also points out that given square in the small language, we can have flsquare in the large language, though I don't think having the latter requires having the former.]

In addition, there are 20,340 Google hits for ["(define (square x)" ss|scm].

descriptionBradley Lucier writes (lightly edited): A `square` primitive is useful in calculating with bignums because squaring a bignum is generally cheaper than multiplying two different bignums of the same size. For example, Gambit's runtime checks trivially whether the two arguments in `(* a b)` are `eq?` before calling the appropriate algorithm. Generally, it may be better to be able to express this primitive directly. [He also points out that given `square` in the small language, we can have `flsquare` in the large language, though I don't think having the latter requires having the former.] Bradley Lucier writes (lightly edited): A `square` primitive is useful in calculating with bignums because squaring a bignum is generally cheaper than multiplying two different bignums of the same size. For example, Gambit's runtime checks trivially whether the two arguments in `(* a b)` are `eq?` before calling the appropriate algorithm. Generally, it may be better to be able to express this primitive directly. [He also points out that given `square` in the small language, we can have `flsquare` in the large language, though I don't think having the latter requires having the former.] In addition, there are 20,340 Google hits for ["(define (square x)" ss|scm].
statusnewdecided

The WG voted to adopt this proposal.

owneralexshinncowan
statusdecidedwriting
resolutionfixed
statuswritingclosed