[Top][All Lists]

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

number->string of float with radix

From: Bill Schottstaedt
Subject: number->string of float with radix
Date: Mon, 14 Oct 2002 03:55:02 -0700

guile> (number->string 5 2.0)
standard input:1:1: In procedure number->string in expression (number->string 5 
standard input:1:1: Wrong type argument in position 2 (expecting INUMP): 2.0
ABORT: (wrong-type-arg)

"INUMP" is internal jargon -- "integer" or "exact integer" would be better.

Also, I wonder about these kinds of calls:

guile> (number->string 10.5 2)

It's actually not senseless to have base-2 float notation ("1010.1", "a.8" hex),
but if Guile just returns base 10, maybe it should warn the caller?  Otherwise,
for example, string->number does not invert number->string:

guile> (string->number "10.5" 2)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]