Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request From: schroder@papaya.bbn.com Newsgroups: comp.sys.sun Subject: Why big buffers for floating doprints? Keywords: Miscellaneous Message-ID: <5849@brazos.Rice.edu> Date: 16 Mar 90 20:32:00 GMT Sender: news@rice.edu Organization: Sun-Spots Lines: 16 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 9, Issue 88, message 8 We frequently use multitasking, with modest stacks allocated from the heap. We recently discovered that "sprintf()" in Sun release 4.x was overrunning the stack -- using **over 20k of stack** to convert little numbers like 0.334 and so forth. A little research with adb uncovered: binary_to_decimal_integer: linkw a6,#-0x308c // 12,428 bytes binary_to_decimal_fraction: linkw a6,#-0x3080 // 12,416 bytes unpacked_to_decimal: linkw a6,#-0x15b0 // 5,552 bytes Does anyone out there know why it takes over 12K to convert a floating point number? Release 3.5 convert a float in under 900 bytes. :-) Regards, Ken