Search found 2 matches
- Wed Jun 02, 2010 5:10 am
- Forum: Common Lisp
- Topic: Float to rational convert
- Replies: 3
- Views: 4416
Re: Float to rational convert
Common Lisp already has functions for this conversion: RATIONAL and RATIONALIZE . when i try to use the RATIONALIZE function, i receive an error: > (rationalize -11/100) Error: The function RATIONALIZE is not defined. and the RATIONAL function has another output, not a good one. Example: > (rationa...
- Wed Jun 02, 2010 3:06 am
- Forum: Common Lisp
- Topic: Float to rational convert
- Replies: 3
- Views: 4416
Float to rational convert
hi everyone. i have a problem, and i cannot solve it. I'm trying to convert from a float number, to a rational one, in common lisp. An example would be this one: (float-to-rational 1.2) 12/10 and: (rational-to-float 3/2) 1.5 I tried to write a function, but i still cannot do it. I want to say that i...