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

[sc-dev] SF.net SVN: supercollider:[8240] trunk/Source/lang/LangSource/PyrLexer.cpp



Revision: 8240
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8240&view=rev
Author:   sicklincoln
Date:     2008-12-22 09:40:51 +0000 (Mon, 22 Dec 2008)

Log Message:
-----------
fixed (I hope) floating point base bug; due to counting decimal point in the total number of active columns divided by one base multiple too many

Modified Paths:
--------------
    trunk/Source/lang/LangSource/PyrLexer.cpp

Modified: trunk/Source/lang/LangSource/PyrLexer.cpp
===================================================================
--- trunk/Source/lang/LangSource/PyrLexer.cpp	2008-12-22 09:05:57 UTC (rev 8239)
+++ trunk/Source/lang/LangSource/PyrLexer.cpp	2008-12-22 09:40:51 UTC (rev 8240)
@@ -165,7 +165,8 @@
 		else if (c >= 'A' && c <= 'A' + sc_min(36,base) - 11) z = z * base + c - 'A' + 10;
 		else if (c == '.') decptpos = i;
 	}
-	z = z / pow((double)base, n - decptpos); 
+	//calculation previously included decimal point in count of columns (was n-decptpos); there are 1 less than n characters which are columns in the number contribution
+	z = z / pow((double)base, n -1- decptpos); 
 	return z;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/