[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Re: How many years?
On 9/19/10 6:57 AM, Lucas Samaruga wrote:
I have this but lacks precision...
a = 1 / 3; // 0.33333333333333
b = a * 3; // 1 why?
c = a + a + a; // 1 why?
// hmmmmm...
0.33333333333333 + 0.33333333333333 + 0.33333333333333; // 0.99999999999999
d = 1 - 0.99999999999999;
d * 60 * 60 * 24 * 365 * 3174
// ...mmmmmmmm...
Posting precision is less than calculation precision IIRC. (If it always
posted full precision, 1.1 would look like 1.100000000001 and that would
freak you out for normal use.)
But that led me to this bizarrerie:
(1/3).postcs
// prints:
0.333333
0.33333333333333
^^^ huh? The compile string has less precision than the normal asString?
Smells like a bug.
hjh
--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/