[clean-list] Calling C with side effects
Matthew Bromberg
mattcbro at earthlink.net
Fri Jun 2 18:08:30 MEST 2006
I found an old copy of the ftoa function in C and then hacked away at it
until I got something reasonable.
I then used clean to try to bound the characters into a fixed size
field, for both complex and real. It was more trouble than it
was worth and probably still buggy. The ftoa could easily be converted
into clean itself. If you want the code let me know.
Regards
John van Groningen wrote:
> Matthew Bromberg wrote:
>
>> WriteFile or better the stream libraries are just fine, however the only way to format a Real type into text, that I've currently found is
>> to use toString. Imagine therefore trying to print out, say exp(20) in 8 characters or less. It requires exponential notation.
>> That's why I found myself longing for a printf function to format floating point numbers and print to the console. Are there
>> any other functions available for producing formatted floating point?
>>
>
> No, not yet. Maybe you can use the toStringWith function from the language shootout:
>
> http://darcs.complete.org/local-branches/shootout.upstream/bench/Include/clean/LanguageShootout.icl
>
> Regards,
>
> John van Groningen
>
>
More information about the clean-list
mailing list