freenode/#sicl - IRC Chatlog
Search
4:18:09
no-defun-allowed
well, not 1 byte floats in consumer hardware, but it seems to imply it's for consumer hardware since that's all we develop for
4:18:41
no-defun-allowed
(i saw those in the paper on stoichastic rounding for neural network evaluation and training)
4:19:19
no-defun-allowed
i figure the author got confused and added short and long float sizes and got to 12 bytes
4:20:27
no-defun-allowed
it doesn't seem too reliable since, well, the cover is some kind of stock image of one of those internet "tunnels" with 0s and 1s on it and the book is typeset in the default Word font
4:25:15
no-defun-allowed
and i assume my teacher (who is probably better with mathematics and physics) learnt from it, because one of the lessons had a table copied from the book with the same inaccurate values, and he ported the binary search code with the same -1 = not found value, instead of using the exception system
4:27:07
no-defun-allowed
http://adrianjansonpublishing.com.au/files/ccart/5979daf33bd1c.png <-- very reliable textbook cover
4:29:27
no-defun-allowed
true, CL:FIND gives you NIL, but there was no specification given and since BASIC, no wait, my bad, pseudocode, is statically typed apparently, i think an exception would be the easier way out
4:34:36
no-defun-allowed
maybe it's somewhat practical in Python where lists/arrays are dynamic and are effectively a list of parts of the list, but insertion into a sorted array would still be O(n) so a tree would be better for O(log n) operations
4:37:39
beach
In some languages, `list' is in fact a tree structure that allows insertion and deletion in O(log n), but then access to an element is O(log n) as well.
4:41:27
no-defun-allowed
i don't know implementation details, but `[1] * 10000` and `[1 for _ in range(10000)]` use different amounts of memory due to the way they're constructed
5:01:40
|3b|
NIL is better than -1, since it will error if you try to do math on it without checking
5:03:35
|3b|
also, NIL/index can be used directly as a boolean in lisp unlike -1/index in any language i can think of
5:16:19
no-defun-allowed
0 is falsy in C-family languages so if your item is the first it wouldn't work too well
5:16:58
no-defun-allowed
i think some C string searching functions do use -1 as a return value though, but that's C which doesn't have dynamic types, maybe types or exception handling
5:38:12
jcowan
-1 is used when you are searching a collection; the function returns an index or -1 if the item being searched for is not found
5:39:11
jcowan
as for floats, the PDP-10 used 36-bit single floats and 72-bit double floats, since it had a 36-bit integer size and an 18-bit pointer size
5:40:54
jcowan
oho, here we are: "The Motorola 6888x math coprocessors and the Motorola 68040 and 68060 processors support this same 64-bit significand extended precision type (similar to the Intel format although padded to a 96-bit format with 16 unused bits inserted between the exponent and significand fields)." WP, s.v. "Extended precision"
5:41:51
jcowan
by "Intel format" is meant the 80-bit representation first used by the 8087 chip, which does not have a hidden bit.
5:49:08
no-defun-allowed
now i believe the last 68k mac used a 68040, so i suppose that was the last 12 byte float format in a personal computer
5:52:24
no-defun-allowed
the Quadra 630 was not manufactured after 1995, so the book is 20 years out of date as it was published in 2015
7:06:32
Shinmera
For texture formats https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
7:07:17
no-defun-allowed
r2g3b2 and r5g6b6 were common back in the day, since a pixel used 8 and 16 bits
7:20:44
|3b|
screens probably use integer colors, but probably with an exponential in between, so the color space isn't linear across that integer range
7:21:37
no-defun-allowed
yeah, monitors and eyes won't be linear so usually you need correction done through colour calibration
8:54:55
no-defun-allowed
Anyways, I have finished an errata list of everything I can comment on, and probably should write the author/publishers an email about what probably isn't correct in the book.
8:56:02
no-defun-allowed
Maybe next year when the VCE specifications are redone, they'll pick a better book and/or author.
9:33:27
no-defun-allowed
VCE is the Victorian Certificate of Education, but the name for the subject now is "Software Development". Oops. 3/4 is shorthand for Units 3 and 4, which are the last two semesters of high school.