From 337e171cdc846c432dc23d47a4c17246a05641b4 Mon Sep 17 00:00:00 2001 From: Steve Dekorte Date: Wed, 19 Sep 2007 16:48:00 -0700 Subject: [PATCH] log2 update --- libs/iovm/source/IoNumber.c | 15 ++++++-- projects/osxvm/osxvm.xcodeproj/steve.mode1 | 17 ++++----- projects/osxvm/osxvm.xcodeproj/steve.pbxuser | 57 ++++++++++++++++------------ 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/libs/iovm/source/IoNumber.c b/libs/iovm/source/IoNumber.c index 04db7ee..d3f66c5 100644 --- a/libs/iovm/source/IoNumber.c +++ b/libs/iovm/source/IoNumber.c @@ -643,10 +643,19 @@ down to the nearest integer if it's fractional component is not 0.") IoObject *IoNumber_log(IoNumber *self, IoObject *locals, IoMessage *m) { /*#io - docSlot("log", "Returns the natural logarithm of the receiver.") + docSlot("log", "Returns the logarithm of the receiver. The base +is taken as the value of the first argument or the constant e if +the first argument is omitted.") */ - return IONUMBER(log(DATA(self))); + float base; + if(IoMessage_argCount(m) > 0){ + base = DATA(IoMessage_locals_numberArgAt_(m, locals, 0)); + } + else{ + base = M_E; + } + return IONUMBER(log(DATA(self)) / log(base)); } IoObject *IoNumber_log2(IoNumber *self, IoObject *locals, IoMessage *m) @@ -655,7 +664,7 @@ IoObject *IoNumber_log2(IoNumber *self, IoObject *locals, IoMessage *m) docSlot("log2", "Returns the base 2 logarithm of the receiver.") */ - return IONUMBER(log2(DATA(self))); + return IONUMBER(log(DATA(self)) / log(2)); } IoObject *IoNumber_log10(IoNumber *self, IoObject *locals, IoMessage *m) diff --git a/projects/osxvm/osxvm.xcodeproj/steve.mode1 b/projects/osxvm/osxvm.xcodeproj/steve.mode1 index 33d6fa6..c9510a5 100644 --- a/projects/osxvm/osxvm.xcodeproj/steve.mode1 +++ b/projects/osxvm/osxvm.xcodeproj/steve.mode1 @@ -292,7 +292,7 @@ 275 RubberWindowFrame - 128 138 1281 716 0 0 1440 900 + 97 123 1281 716 0 0 1440 900 Module PBXSmartGroupTreeModule @@ -322,7 +322,7 @@ _historyCapacity 0 bookmark - AA716C080C93576E0008DB28 + AAB2BA040C9DBECC000192E1 history AA9349510C4EE76B0017FDA0 @@ -348,7 +348,7 @@ AA716BF10C93576E0008DB28 AA716BF30C93576E0008DB28 AA716BF50C93576E0008DB28 - AA716BF70C93576E0008DB28 + AA716C080C93576E0008DB28 nextStack @@ -386,7 +386,7 @@ Frame {{0, 0}, {984, 670}} RubberWindowFrame - 128 138 1281 716 0 0 1440 900 + 97 123 1281 716 0 0 1440 900 Module PBXNavigatorGroup @@ -406,7 +406,7 @@ Frame {{0, 675}, {984, 0}} RubberWindowFrame - 128 138 1281 716 0 0 1440 900 + 97 123 1281 716 0 0 1440 900 Module XCDetailModule @@ -430,9 +430,9 @@ TableOfContents - AA716C0A0C93576E0008DB28 + AAB2BA020C9D9CA6000192E1 1CE0B1FE06471DED0097A5F4 - AA716C0B0C93576E0008DB28 + AAB2BA030C9D9CA6000192E1 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 @@ -566,11 +566,10 @@ 5 WindowOrderList - 1C0AD2B3069F1EA900FABCE6 /Users/steve/Io/projects/osxvm/osxvm.xcodeproj WindowString - 128 138 1281 716 0 0 1440 900 + 97 123 1281 716 0 0 1440 900 WindowTools diff --git a/projects/osxvm/osxvm.xcodeproj/steve.pbxuser b/projects/osxvm/osxvm.xcodeproj/steve.pbxuser index f4ef83a..ecc8535 100644 --- a/projects/osxvm/osxvm.xcodeproj/steve.pbxuser +++ b/projects/osxvm/osxvm.xcodeproj/steve.pbxuser @@ -36,8 +36,8 @@ PBXFileDataSource_Target_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 210902263; - PBXWorkspaceStateSaveDate = 210902263; + PBXPerProjectTemplateStateSaveDate = 211655837; + PBXWorkspaceStateSaveDate = 211655837; }; perUserProjectItems = { AA344B160C729DC400464C3F /* PBXTextBookmark */ = AA344B160C729DC400464C3F /* PBXTextBookmark */; @@ -52,7 +52,6 @@ AA716BF10C93576E0008DB28 /* PBXTextBookmark */ = AA716BF10C93576E0008DB28 /* PBXTextBookmark */; AA716BF30C93576E0008DB28 /* PBXTextBookmark */ = AA716BF30C93576E0008DB28 /* PBXTextBookmark */; AA716BF50C93576E0008DB28 /* PBXTextBookmark */ = AA716BF50C93576E0008DB28 /* PBXTextBookmark */; - AA716BF70C93576E0008DB28 /* PBXTextBookmark */ = AA716BF70C93576E0008DB28 /* PBXTextBookmark */; AA716BF90C93576E0008DB28 /* PBXTextBookmark */ = AA716BF90C93576E0008DB28 /* PBXTextBookmark */; AA716BFA0C93576E0008DB28 /* PBXTextBookmark */ = AA716BFA0C93576E0008DB28 /* PBXTextBookmark */; AA716BFB0C93576E0008DB28 /* PBXTextBookmark */ = AA716BFB0C93576E0008DB28 /* PBXTextBookmark */; @@ -68,6 +67,7 @@ AA9349550C4EE76B0017FDA0 /* PBXTextBookmark */ = AA9349550C4EE76B0017FDA0 /* PBXTextBookmark */; AA93496B0C4EEA640017FDA0 /* PBXTextBookmark */ = AA93496B0C4EEA640017FDA0 /* PBXTextBookmark */; AA93496C0C4EEA640017FDA0 /* PBXTextBookmark */ = AA93496C0C4EEA640017FDA0 /* PBXTextBookmark */; + AAB2BA040C9DBECC000192E1 /* PBXTextBookmark */ = AAB2BA040C9DBECC000192E1 /* PBXTextBookmark */; AAC373880C5E74D900A8FABB /* PBXTextBookmark */ = AAC373880C5E74D900A8FABB /* PBXTextBookmark */; AAC373890C5E74D900A8FABB /* PBXTextBookmark */ = AAC373890C5E74D900A8FABB /* PBXTextBookmark */; AAC3738A0C5E74D900A8FABB /* PBXTextBookmark */ = AAC3738A0C5E74D900A8FABB /* PBXTextBookmark */; @@ -240,6 +240,7 @@ }; AA716BEB0C93576E0008DB28 /* uuid.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = uuid.h; path = "/Users/steve/Downloads/uuid-1.5.1/uuid.h"; sourceTree = ""; @@ -256,6 +257,7 @@ }; AA716BED0C93576E0008DB28 /* uuid.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = uuid.c; path = "/Users/steve/Downloads/uuid-1.5.1/uuid.c"; sourceTree = ""; @@ -272,6 +274,7 @@ }; AA716BEF0C93576E0008DB28 /* IoUUID.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = IoUUID.c; path = /Users/steve/Io/addons/UUID/source/IoUUID.c; sourceTree = ""; @@ -298,6 +301,7 @@ }; AA716BF20C93576E0008DB28 /* IoDKDB.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = IoDKDB.c; path = /Users/steve/Io/addons/QDBM/source/IoDKDB.c; sourceTree = ""; @@ -314,6 +318,7 @@ }; AA716BF40C93576E0008DB28 /* IoDKFolderCursor.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = IoDKFolderCursor.h; path = /Users/steve/Io/addons/QDBM/source/IoDKFolderCursor.h; sourceTree = ""; @@ -330,32 +335,11 @@ }; AA716BF60C93576E0008DB28 /* IoDKFolder.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = IoDKFolder.h; path = /Users/steve/Io/addons/QDBM/source/IoDKFolder.h; sourceTree = ""; }; - AA716BF70C93576E0008DB28 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = AA716BF80C93576E0008DB28 /* IoDKDB.h */; - name = "(null): 52"; - rLen = 0; - rLoc = 1633; - rType = 0; - vrLen = 1355; - vrLoc = 314; - }; - AA716BF80C93576E0008DB28 /* IoDKDB.h */ = { - isa = PBXFileReference; - lastKnownFileType = sourcecode.c.h; - name = IoDKDB.h; - path = /Users/steve/Io/addons/QDBM/source/IoDKDB.h; - sourceTree = ""; - uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {943, 969}}"; - sepNavSelRange = "{1577, 0}"; - sepNavVisRect = "{{0, 306}, {943, 638}}"; - }; - }; AA716BF90C93576E0008DB28 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = AA8383A60BDFCE0100B4F003 /* IoVMApi.h */; @@ -398,6 +382,7 @@ }; AA716BFD0C93576E0008DB28 /* uuid.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = uuid.h; path = "/Users/steve/Downloads/uuid-1.5.1/uuid.h"; sourceTree = ""; @@ -414,6 +399,7 @@ }; AA716BFF0C93576E0008DB28 /* uuid.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = uuid.c; path = "/Users/steve/Downloads/uuid-1.5.1/uuid.c"; sourceTree = ""; @@ -430,6 +416,7 @@ }; AA716C010C93576E0008DB28 /* IoUUID.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = IoUUID.c; path = /Users/steve/Io/addons/UUID/source/IoUUID.c; sourceTree = ""; @@ -446,6 +433,7 @@ }; AA716C030C93576E0008DB28 /* IoDKDB.c */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.c; name = IoDKDB.c; path = /Users/steve/Io/addons/QDBM/source/IoDKDB.c; sourceTree = ""; @@ -462,6 +450,7 @@ }; AA716C050C93576E0008DB28 /* IoDKFolder.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = IoDKFolder.h; path = /Users/steve/Io/addons/QDBM/source/IoDKFolder.h; sourceTree = ""; @@ -478,6 +467,7 @@ }; AA716C070C93576E0008DB28 /* IoDKFolder.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = IoDKFolder.h; path = /Users/steve/Io/addons/QDBM/source/IoDKFolder.h; sourceTree = ""; @@ -494,6 +484,7 @@ }; AA716C090C93576E0008DB28 /* IoDKDB.h */ = { isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = IoDKDB.h; path = /Users/steve/Io/addons/QDBM/source/IoDKDB.h; sourceTree = ""; @@ -570,6 +561,22 @@ sepNavVisRect = "{{0, 0}, {643, 590}}"; }; }; + AAB2BA040C9DBECC000192E1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = AAB2BA050C9DBECC000192E1 /* IoDKDB.h */; + name = "(null): 50"; + rLen = 0; + rLoc = 1577; + rType = 0; + vrLen = 1354; + vrLoc = 315; + }; + AAB2BA050C9DBECC000192E1 /* IoDKDB.h */ = { + isa = PBXFileReference; + name = IoDKDB.h; + path = /Users/steve/Io/addons/QDBM/source/IoDKDB.h; + sourceTree = ""; + }; AAC373880C5E74D900A8FABB /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = AAE216860C5821670017F17D /* IoTagDB.c */; -- 2.11.4.GIT