Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!bloom-beacon!mit-eddie!andante!bwb From: bwb@andante.UUCP (Bruce Ballard) Newsgroups: comp.sys.mac.programmer Subject: printf and logs in THINK C 4.0 Message-ID: <22621@andante.UUCP> Date: 25 Aug 89 14:15:38 GMT Organization: AT&T Bell Laboratories, Murray Hill Lines: 32 I'd like to use printf and log-base-2 in THINK C 4.0. My concerns are: 1. When I use printf, some keyboard events don't get reported to my program. I had been doing GetNextEvent (keyDownMask, &theEvent) in my printing loop to look for "." pressed with the command key so I could cancel printing. Unlike with version 3.0, some part of the ANSI library in 4.0 detects this keystroke: if it's printing at the time, it quits my application, otherwise it just beeps. My work-around so far is to use GetKeys. How can/should I be doing this? (It also seems that command-key equivalents don't work when printf's console window is up. Argh.) 2. I need to find log base 2, but there only seem to be natural log and log base 10. It's trivial to convert from one to another by a simple multiplication, but I see that the code in math.c does static double Log2Ten = 3.321928094887362348; ... elems68k(&x, FLOG2X); /* LOG2 is much faster than LN */ x /= Log2Ten; Clearly I would settle for the elems68k call, since it has just what I want: can I get to it? I spent a while looking through the documentation and poking through source code but I can't find it. Thanks in advance to any helpers out there. -Bruce Ballard bwb@allegra.att.com