Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Declaring return type of a function
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rugilbert17  
View profile  
 More options Mar 15 2012, 4:58 pm
Newsgroups: comp.lang.lisp
From: rugilbert17 <rugilber...@zedmail.qux>
Date: Thu, 15 Mar 2012 16:58:28 -0400
Local: Thurs, Mar 15 2012 4:58 pm
Subject: Re: Declaring return type of a function
On 15/03/2012 4:44 PM, Espen Vestre wrote:

> Jack<jack.moll...@gmail.com>  writes:

>> I have a function that returns a list of integers and I want to apply
>> the * operator to that list.  Once the list gets beyond a certain
>> size, I get a floating point error.  How do I tell CCL that it's okay
>> to use bignums for this calculation?

> Hi Jack!

> Are you sure you get a "floating point error"? From your description, it
> sounds like you apply * to a list that is longer than the maximal number
> of arguments to * that CCL can take.

> The standard solution to this (i.e. whenever you have a list of numbers
> that may be arbitrary long and want to apply * or other similar
> functions to it) is to use REDUCE instead of APPLY:

Clojure, of course, doesn't have this problem.

user=> (apply + (range 1000000))
499999500000

user=> (reduce + (range 1000000))
499999500000


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.