[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: Brian Gregor <bgregor@BUPHY.bu.edu>*Subject*: Re: dumb DrScheme rational # question*From*: Robert Bruce Findler <robby@cs.rice.edu>*Date*: Tue, 29 Jan 2002 07:57:06 -0800*CC*: <plt-scheme@fast.cs.utah.edu>*In-Reply-To*: <Pine.SGI.4.33.0201291046370.27459769-100000@buphy.bu.edu>*References*: <Pine.SGI.4.33.0201291046370.27459769-100000@buphy.bu.edu>*Sender*: owner-plt-scheme@fast.cs.utah.edu

Quoting Brian Gregor: > > DrScheme (v 200alpha9) returns rational #'s for many > division operations. Is there a way to force it to > convert to a floating point number? Common Lisp > has a 'float' function for this, but MzScheme doesn't > seem to have any such equivalent. You can use exact->inexact, or if you start your computations with inexact numbers, they will remain inexact when going thru the division operations. To write an inexact constant, prefix the numbers with #i, like this: #i1.0 Additionally, if you use functions that return real results (sin, sqrt, log, etc) you will get inexact numbers from them. But, you should really only be doing that kind of thing if you are running into efficiency issues, I'd say. Hope that helps, Robby

**Follow-Ups**:**Re: dumb DrScheme rational # question***From:*Richard Cobbe <cobbe@airmail.net>

**References**:**dumb DrScheme rational # question***From:*Brian Gregor <bgregor@BUPHY.bu.edu>

- Prev by Date:
**Re: dumb DrScheme rational # question** - Next by Date:
**Re: dumb DrScheme rational # question** - Prev by thread:
**Re: dumb DrScheme rational # question** - Next by thread:
**Re: dumb DrScheme rational # question** - Index(es):